4

I've got some UI Automation tests for a universal app that I'm running from the command line. They are working great, but the command line always launches the iPad simulator, and I'd like to be able to run them on both the iPhone simulator and the iPad simulator.

In Instruments I can control this with with the Options|Simulator Configuration menu, but I can't seem to control it via the command line. Is there a way to run UI Automation tests from the command line for a universal app against both the iPad and iPhone simulators?

Brian Yarger
  • 1,965
  • 18
  • 17
  • I tried changing the running simulator to iPhone (through the Hardware menu) but anytime I launch the UI Automation tests it changes the running emulator back to iPad. – Brian Yarger Nov 10 '11 at 17:59

2 Answers2

3

Make a separate target (i.e. another version of your app) which is iPhone-only, this will force instruments to use the iPhone simulator, rather than iPad.

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

Jan Svarovsky
  • 236
  • 2
  • 5
0

Morning.

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

Is it possible to specify a version of the sdk when running your tests using the -sdk parameter - if so, could you specify an iOS version that isn't for the iPad?

Or, if that doesn't work could you run a script that changes the device during your automated tests - i.e. similar to this answer : How can I reset the iOS Simulator from the command line?

Community
  • 1
  • 1
deanWombourne
  • 38,189
  • 13
  • 98
  • 110