9

I have been trying to get xcodebuild tests to work on a remote machine using Jenkins. I ran into the error of not being able to launch a GUI through SSH and solved it by launching a slave through JNLP as suggested here: Timeout when running xcodebuild tests under Xcode 6 via SSH. Now I'm getting a new error:

Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Canceling tests due to timeout in Waiting for test process to check in..."

I also get these errors whether I successfully build and run the tests on the terminal or through Jenkins:

iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 "Simulator verification failed." {NSLocalizedFailureReason=A connection to the simulator verification service could not be established., NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with ownership enabled., NSLocalizedDescription=Simulator verification failed.}

iPhoneSimulator: Unable to connect to "com.apple.instruments.deviceservice.lockdown" (Error Domain=com.apple.CoreSimulator.SimError Code=146 "Unable to lookup in current state: Shutdown"

I've made sure ownership is enabled where XCode is installed, I've reset the content and settings on the simulator, and I've moved my plist file into /Library/LaunchAgents. I've tried Googling these errors and could not find anything that seems to relate to my issue. Does anyone have any other suggestions?

Other information:

XCode Version 6.2 (6C131e)

Log file:

2015-03-24 12:14:10.719 Beginning test session with Xcode 6C131e
2015-03-24 12:14:10.720 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test -project proj.xcodeproj -scheme development -destination platform=iOS Simulator,name=iPad Air
2015-03-24 12:14:10.720 Testing on device: <DVTiPhoneSimulator: 0x7f8235cb3570> {SimDevice: SimDevice : iPad Air (625C9344-19B9-4F6C-B70B-8BDD3B753E17) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-Air } runtime={ SimRuntime : 8.2 (12D508) - com.apple.CoreSimulator.SimRuntime.iOS-8-2 }}
2015-03-24 12:14:10.720 Writing testing status log to /var/folders/mx/9d2jm4sj6t54sld_9cj1bgz40000gn/T/com.apple.dt.XCTest-status/Session-2015-03-24_12:14:10-QR746X.log.
2015-03-24 12:14:10.720 Initializing test infrastructure.
2015-03-24 12:14:10.749 Creating the connection.
2015-03-24 12:14:10.749 Listening for proxy connection request from the test bundle (all platforms)
2015-03-24 12:14:10.749 Resuming the connection.
2015-03-24 12:14:10.749 Test connection requires daemon assistance.
2015-03-24 12:14:10.933 Checking test manager availability..., will wait up to 120s
2015-03-24 12:14:10.936 testmanagerd handled session request.
2015-03-24 12:14:10.936 Waiting for test process to launch.
2015-03-24 12:14:15.951 Launch session started, setting a disallow-finish-token on the run operation.
2015-03-24 12:14:15.952 Waiting for test process to check in..., will wait up to 120s
2015-03-24 12:14:15.979 Adding console adaptor for test process.
2015-03-24 12:16:15.956 Unable to get debug console for logging target process thread state.
2015-03-24 12:16:15.956 Test operation failure: Canceling tests due to timeout in Waiting for test process to check in...
2015-03-24 12:16:15.956 _finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Canceling tests due to timeout in Waiting for test process to check in..." UserInfo=0x7f8231c1dff0 {NSLocalizedDescription=Canceling tests due to timeout in Waiting for test process to check in...} didCancel: 1
Community
  • 1
  • 1
PastryPup
  • 166
  • 1
  • 8
  • Seeing exactly the same "Simulator verification failed" error when trying to run the tests with xcodebuild from the command line. Same version and build number of Xcode (6C131e). For us, this started some time after upgrading to Xcode 6.2. Tests used to run fine, though I'm not exactly sure when they started failing because someone disabled them on our build box at some point. If/when I find a solution, I'll post an answer here. If you did something, I'd appreciate if you could do the same. – Dave Klotz Apr 01 '15 at 16:22
  • Turned out to be a red herring for me. I was getting, and am still getting, the error, but the tests weren't running for a totally different reason. My dumb ass just couldn't get past the initial error. Once I fixed that tests ran. There is some action on this in the Apple dev forums though: https://devforums.apple.com/thread/264762?start=0&tstart=0 – Dave Klotz Apr 02 '15 at 19:32
  • Thanks for the link! I'll try theri suggestions next and will definitely update if I ever find a solution. – PastryPup Apr 02 '15 at 21:50
  • Okay, I have a solution! Here are the steps that worked for me: reboot the machine, start the XCode app from Finder, quit XCode, then run Jenkins script. I'm thinking it mostly has something to do with launching XCode first from Finder. I still see the errors, but at least the unit tests run now. Thanks for pointing me in the right direction Dave! – PastryPup Apr 02 '15 at 22:04
  • Please formulate an answer below so this question is more useful to the community, and then accept it. – isherwood Apr 06 '15 at 15:17

3 Answers3

1

You can resolve the "Simulator Verification Failed" error (Code=53) with the steps below. (For me, this problem was caused by conflict of command-line development tools and also due to Mac OS folder permission issues with the tools).

I was able to resolve it following these:

  1. Quit any running instances of Xcode, Instruments and iOS simulators
  2. Removing the developer folder: /Library/Developer
  3. Remove all your Xcode installations: /Applications/Xcode.app,...
  4. Reboot your Mac
  5. Download Xcode.dmg from Apple Developer Portal (NOT from the App Store)
  6. Reinstall Xcode
  7. Launch Xcode

Optionally, though not the best thing to do, if you wanna install multiple versions of Xcode, make sure you activate the right Xcode version from Xcode Preferences/Locations/Command-Line Tools, before building your projects.

Hope this helps.

Yonathan W'Gebriel
  • 1,048
  • 7
  • 11
0

I still see the error messages, but I was able to get Jenkins to run my unit tests. Here are the steps that worked for me:

  1. Reboot the remote machine
  2. Start the Xcode app from Finder
  3. Quit Xcode
  4. Run Jenkins test script
PastryPup
  • 166
  • 1
  • 8
0

See my solution here: https://stackoverflow.com/a/40790171/480467

The problem lies in the fact that the timeout counter in xcodebuild starts as soon as the command is executed, so the compile time counts towards the timeout (which is 120 seconds).

Community
  • 1
  • 1
Werner Altewischer
  • 10,080
  • 4
  • 53
  • 60