Note: device names are changed in Xcode 7, so you no longer specify them with iPhone 5 (9.1 Simulator) , but rather iPhone 5 (9.1) .
Use xcrun instruments -s to get the current list of devices, and then you can pre-launch it using:
xcrun instruments -w "iPhone 5 (9.1)" || echo "(Pre)Launched the simulator."
Prelaunching
I got to the point that what I suggested there didn’t work anymore. In addition to making the changes mentioned here, you need to run the simulator. Xcodebuild is waiting BEFORE . Xcodebuild launched:
Old post
This bug is fixed in Xcode 6.3 and above. If you encounter similar problems in the new Xcode, this is probably another mistake.
Apple is tracking error ID # 18001199:
The context provided by LaunchDaemons is not supported to launch the Application GUI. SSH service and default setting for Jenkins: both implemented as LaunchDaemons. In earlier versions of Xcode 5, in this context, xcodebuild can run tests on the iOS simulator, but which was never supported, and as you noticed, it no longer works with Xcode 6.
Unlike LaunchDaemons, LaunchAgents provides a context in which you can run GUI Applications - if the user is logged in at that time, with the server / Aqua window. Converting Jenkins configuration from being LaunchDaemon to becoming LaunchAgent is a question. You can also use launchd to run tests on an iOS simulator from an SSH session, either by creating a LaunchAgent, either manually downloading / launching, or using the "launchctl submit".
Well, after we work a bit around the comments (thanks to Opal ), I found out that running a slave device through JNLP works.
As many people have mentioned, it is currently not possible to run unit test on top of SSH, so you can now contact the JNLP agent until Apple fixes it.
If connecting to JNLP still does not solve it, try the solution mentioned in this comment .
ie: Run them at the command prompt:
DevToolsSecurity -enable
sudo dscl. -append / Groups / _developer GroupMembership "user-that-runs-the-sim"
security authorizationdb write system.privilege.taskport is-developer
See links here and here .
I recently found out that if you install a new version of Xcode and do not start it. The simulator can start the countdown again. To solve this problem, I had to manually start Xcode and install the additional tools that it requested.