UI Automation Command Line Configures Which Simulator For Universal Application

I have UI Automation tests for a generic application that I run from the command line. They work fine, but the command line always launches the iPad simulator, and I would like to be able to run them on both the iPhone simulator and the iPad simulator.

In Tools, I can control this using the Options | Configuration Simulator menu, but I cannot control it using the command line. Is there a way to run UI Automation tests from the command line for a universal application for both iPad simulators and iPhone?

+4
source share
2 answers

Make a separate goal (i.e. a different version of your application) that is only for the iPhone, this will force the tools to use the iPhone simulator, not the iPad.

In other words, set TARGETED_DEVICE_FAMILY = 1. in your new target config TARGETED_DEVICE_FAMILY = 1.

+3
source

Morning.

Take a look at this question: xcodebuild: simulator or device?

Is it possible to specify the sdk version when performing your tests using the -sdk parameter - if so, can you specify an iOS version that is not designed for the iPad?

Or, if this does not work, you can run a script that will change the device during your automatic tests - that is, it seems like this answer: How can I reset iOS Simulator from the command line?

0
source

Source: https://habr.com/ru/post/1380416/


All Articles