当通过 JNLP 使用 Jenkins 时,iOS 测试不会在模拟器上 运行
iOS tests will not run on simulator when using Jenkins through JNLP
我一直在尝试让 xcodebuild 测试在使用 Jenkins 的远程机器上工作。我 运行 遇到无法通过 SSH 启动 GUI 的错误,并按照此处的建议通过 JNLP 启动从站解决了这个问题:
Timeout when running xcodebuild tests under Xcode 6 via SSH。
现在我收到一个新错误:
Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3“由于等待测试进程签入超时而取消测试...”
无论是在终端上还是通过 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"
我已确保在安装 XCode 的位置启用了所有权,我已重置模拟器上的内容和设置,并将我的 plist 文件移动到 /Library/LaunchAgents。我尝试使用谷歌搜索这些错误,但找不到任何似乎与我的问题相关的内容。有没有人有任何其他建议?
其他信息:
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
我仍然看到错误消息,但我能够让 Jenkins 进行 运行 我的单元测试。以下是对我有用的步骤:
- 重启远程机器
- 从 Finder 启动 Xcode 应用程序
- 退出Xcode
- 运行 Jenkins 测试脚本
您可以通过以下步骤解决“模拟器验证失败”错误(代码=53)。
(对我来说,这个问题是由命令行开发工具的冲突引起的,也是由于工具的 Mac OS 文件夹权限问题)。
我按照这些解决了问题:
- 退出 Xcode、Instruments 和 iOS 模拟器的任何 运行 个实例
- 正在删除开发人员文件夹:/Library/Developer
- 删除所有 Xcode 安装:/Applications/Xcode.app,...
- 重新启动您的 Mac
- 从 Apple 开发者门户下载 Xcode.dmg(不是 从 App Store 下载)
- 重新安装Xcode
- 启动Xcode
可选,虽然不是最好的做法,但如果您想安装 Xcode 的多个版本,请确保激活正确的 Xcode 版本来自 Xcode Preferences/Locations/Command-Line 工具 ,然后再构建您的项目。
希望对您有所帮助。
在这里查看我的解决方案:
问题出在xcodebuild中的超时计数器在命令执行后立即开始,因此编译时间计入超时(120秒)。
我一直在尝试让 xcodebuild 测试在使用 Jenkins 的远程机器上工作。我 运行 遇到无法通过 SSH 启动 GUI 的错误,并按照此处的建议通过 JNLP 启动从站解决了这个问题: Timeout when running xcodebuild tests under Xcode 6 via SSH。 现在我收到一个新错误:
Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3“由于等待测试进程签入超时而取消测试...”
无论是在终端上还是通过 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"
我已确保在安装 XCode 的位置启用了所有权,我已重置模拟器上的内容和设置,并将我的 plist 文件移动到 /Library/LaunchAgents。我尝试使用谷歌搜索这些错误,但找不到任何似乎与我的问题相关的内容。有没有人有任何其他建议?
其他信息:
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
我仍然看到错误消息,但我能够让 Jenkins 进行 运行 我的单元测试。以下是对我有用的步骤:
- 重启远程机器
- 从 Finder 启动 Xcode 应用程序
- 退出Xcode
- 运行 Jenkins 测试脚本
您可以通过以下步骤解决“模拟器验证失败”错误(代码=53)。 (对我来说,这个问题是由命令行开发工具的冲突引起的,也是由于工具的 Mac OS 文件夹权限问题)。
我按照这些解决了问题:
- 退出 Xcode、Instruments 和 iOS 模拟器的任何 运行 个实例
- 正在删除开发人员文件夹:/Library/Developer
- 删除所有 Xcode 安装:/Applications/Xcode.app,...
- 重新启动您的 Mac
- 从 Apple 开发者门户下载 Xcode.dmg(不是 从 App Store 下载)
- 重新安装Xcode
- 启动Xcode
可选,虽然不是最好的做法,但如果您想安装 Xcode 的多个版本,请确保激活正确的 Xcode 版本来自 Xcode Preferences/Locations/Command-Line 工具 ,然后再构建您的项目。
希望对您有所帮助。
在这里查看我的解决方案:
问题出在xcodebuild中的超时计数器在命令执行后立即开始,因此编译时间计入超时(120秒)。