通过JNLP使用Jenkins时,iOStesting不会在模拟器上运行

我一直在试图让xcodebuildtesting在使用Jenkins的远程机器上工作。 我遇到了无法通过SSH启动GUI的错误,并通过JNLP启动从站来解决这个问题,如下所示: 在Xcode 6下通过SSH运行xcodebuildtesting时超时 。 现在我得到一个新的错误:

错误域= IDEUnitTestsOperationsObserverErrorDomain代码= 3“取消testing由于超时在等待testing过程检入…”

无论是在terminal上还是通过Jenkins成功构build和运行testing,我也会遇到这些错误:

iPhoneSimulator:SimVerifier返回:错误域= NSPOSIXErrorDomain代码= 53“模拟器validation失败。 {NSLocalizedFailureReason =无法build立与模拟器validation服务的连接,NSLocalizedRecoverySuggestion =确保Xcode.app安装在启用了所有权的卷上,NSLocalizedDescription =模拟器validation失败。}

iPhoneSimulator:无法连接到“com.apple.instruments.deviceservice.lockdown”(错误域= com.apple.CoreSimulator.SimError代码= 146“无法在当前状态下查找:关机”

我已经确定在安装了XCode的地方启用了所有权,我已经在模拟器上重置了内容和设置,并且将我的plist文件移动到/ Library / LaunchAgents中。 我试着谷歌search这些错误,找不到任何似乎与我的问题有关的东西。 有没有人有任何其他的build议?

其他信息:

XCode版本6.2(6C131e)

日志文件:

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 

您可以通过以下步骤解决“ 模拟器validation失败 ”错误(代码= 53)。 (对我来说,这个问题是由于命令行开发工具的冲突以及Mac OS文件夹权限问题导致的)。

我能够解决这个问题:

  1. 退出任何运行的Xcode,仪器和iOS模拟器的实例
  2. 删除开发者文件夹:/ Library / Developer
  3. 删除所有的Xcode安装:/Applications/Xcode.app,…
  4. 重新启动您的Mac
  5. 从Apple Developer Portal下载Xcode.dmg(而不是从App Store下载)
  6. 重新安装Xcode
  7. 启动Xcode

可选地 ,尽pipe不是最好的做法,但是如果您想要安装多个版本的Xcode,请确保在构build项目之前从Xcode首选项/位置/命令行工具激活正确的Xcode版本。

希望这可以帮助。

我仍然看到错误消息,但是我能够让Jenkins运行我的unit testing。 以下是适合我的步骤:

  1. 重新启动远程机器
  2. 从Finder启动Xcode应用程序
  3. 退出Xcode
  4. 运行Jenkinstesting脚本

看到我的解决scheme在这里: https : //stackoverflow.com/a/40790171/480467

问题在于,一旦命令执行,xcodebuild中的超时计数器就会启动,因此编译时间会计入超时(120秒)。