Search code examples
iosxctool

xctool: how can I choose the iphone6 simulator?


I am running test using xctool, and I would like to be able to choose the simulator. I am using the following line:

xctool -workspace MyProject.xcworkspace -scheme MyProject  test -reporter junit:test-results.xml -reporter teamcity -sdk iphonesimulator

However, the simulator that is open is the iPhone 4s simulator. Does anybody knows how to select the iPhone 6 simulator.


Solution

  • Using the -destination flag you can select a specific device to be run for your simulator :

    -destination platform='iOS Simulator',OS=8.4,name='iPhone 6'
    

    You should try the following command (replacing MyProject by the name of your project):

    xctool -workspace MyProject.xcworkspace -scheme MyProject  test -reporter junit:test-results.xml -reporter teamcity -sdk iphonesimulator -destination platform='iOS Simulator',OS=8.4,name='iPhone 6'