xcodebuild exit code 65 caused by slow boot of the iOS simulator

Originator:C.Jacob
Number:rdar://27524047 Date Originated:
Status: Resolved:
Product:Developer Tools Product Version:
Classification:Crash/Hang/Data Loss Reproducible:Always
 
I'm using a 2015 Macbook (the one with the single USB-C port) for developing and when I'm calling xcodebuild directly from the command line to build my application I get exit code 65 and my tests fail, even though all of my tests ran and all of them were green.
I've pinned this problem down to how xcodebuild is launching the simulator, once it's done with the build action and moves on to the test action I'm passing the command.
When launching the iOS simulator first by calling `xcrun instruments -w 'UUID for the simulator I want'` all my tests pass and I get exit code 0. 
I've tried passing the -destination-timeout flag to xcodebuild but that does not help at all.


---

You have build a fairly big project on a Macbook or in a very slow OSX VM in order to reproduce it. I'd love to provide a test project but I can't at the moment.

---

xcodebuild should launch the specified simulator when the test action is passed along the build action. That way the simulator would already be booted once the test action would get started and no timeout would occur.

---

Something in the build process times out and gives no error message and exit code 65 which could mean anything. A lot of CI products have this issue as well (eg. CircleCI), but I was able to reproduce it on my Macbook locally

---

Tested with all xcodebuild versions shipped with Xcode 7.0 -> 8 beta 2

---

My guess is that this only occurs when a lot of tests are running. I will try to create a sample project that triggers this as well.

Note: A workaround is to launch the GUI simulator with xcrun instruments -w 'iOS Simulator UUID'. Using xcrun simctl does not work.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!