Search code examples
iphoneios-simulatorinstrumentsios-ui-automation

Instruments always launches iPad Simulator for Universal Apps with Automation, how can I force it to use the iPhone Simulator?


I've created a universal binary using iOS 4.2 and Xcode 3.2.5. I'm trying to do some automation testing on the application and since the interfaces are slightly different between the iPad and iPhone versions, I have separate UIAutomation scripts. Unfortunately, no matter what I do, when I click the record button in Instruments, it always starts the application using the iPad simulator. How can I force Instruments to launch the iPhone simulator?

The universal app runs fine in the simulator for all 3 simulated devices (iPhone, iPhone (Retina), and iPad). I can govern the Active Executable via Xcode and "Build and Run/Debug" works fine, correctly using the simulator specified. When I launch Instruments I'm choosing iOS Simulator > All > Automation, then selecting my automation script for the iPhone and then setting the target as project-name/build/Debug-iphonesimulator/project-name.


Solution

  • No need to mess around with your app at all: Instruments allows you to select whether to use the iPhone or iPad simulator. Assuming you've already selected your app:

    1. Click the Target selector (currently displaying your app name).
    2. Click "Edit Active Target"
    3. Near the bottom, click the "Options" drop down.
    4. At the bottom of the list, you can select the "Simulator Configuration".