Ios &引用;无法在模拟器中运行应用程序“;来自TeamCity构建代理
我在TeamCity生成代理输出中看到此错误:Ios &引用;无法在模拟器中运行应用程序“;来自TeamCity构建代理,ios,xcode,ios-simulator,teamcity,Ios,Xcode,Ios Simulator,Teamcity,我在TeamCity生成代理输出中看到此错误: ... [14:17:50][Step 2/2] Starting: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Foobar/Foobar.xcodeproj -scheme foobarNightly SYMROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build OBJROOT=/U
...
[14:17:50][Step 2/2] Starting: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Foobar/Foobar.xcodeproj -scheme foobarNightly SYMROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build OBJROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build test -sdk iphonesimulator8.1
[14:17:50][Step 2/2] in directory: /Users/Me/buildAgent/work/e60c5dca158b2d23
...
[14:17:53][Step 2/2] FoobarTests (BUILD)
[14:17:53]=== BUILD TARGET FoobarTests OF PROJECT Foobar WITH CONFIGURATION Debug ===
[14:17:53]Check dependencies
[14:17:53]Testing failed:
[14:17:53] Test target FoobarTests encountered an error (Unable to run app in Simulator If you believe this error represents a bug, please attach the log file at /var/folders/yy/lc1xnprn1w3g98mcy5mprm5c0000gn/T/com.apple.dt.XCTest-status/Session-2014-11-04_11:17:51-qkVM7k.log)
[14:17:53][Step 2/2] ** TEST FAILED **
[14:17:54][Step 2/2] Process exited with code 65
...
其中所述日志包含:
...
2014-11-04 11:17:51.085 Beginning test session with Xcode 6A1052d
2014-11-04 11:17:51.085 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Foobar/Foobar.xcodeproj -scheme foobarNightly SYMROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build OBJROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build test -sdk iphonesimulator8.1
2014-11-04 11:17:51.085 Testing on device: <DVTiPhoneSimulator: 0x7fcb257b2210> {
SimDevice: SimDevice : iPad 2 (B694B12B-BAE3-48FD-A351-CFC5855B5D14) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-2 } runtime={ SimRuntime : 8.1 (12B411) - com.apple.CoreSimulator.SimRuntime.iOS-8-1 }
}
2014-11-04 11:17:51.085 Initializing test infrastructure.
2014-11-04 11:17:51.085 Writing testing status log to /var/folders/yy/lc1xnprn1w3g98mcy5mprm5c0000gn/T/com.apple.dt.XCTest-status/Session-2014-11-04_11:17:51-qkVM7k.log.
2014-11-04 11:17:51.107 Creating the connection.
2014-11-04 11:17:51.107 Listening for proxy connection request from the test bundle (all platforms)
2014-11-04 11:17:51.107 Resuming the connection.
2014-11-04 11:17:51.107 Test connection requires daemon assistance.
2014-11-04 11:17:51.469 Checking test manager availability..., will wait up to 120s
2014-11-04 11:17:52.148 testmanagerd handled session request.
2014-11-04 11:17:52.148 Waiting for test process to launch.
2014-11-04 11:17:53.323 Launch session started, setting a disallow-finish-token on the run operation.
2014-11-04 11:17:53.323 Waiting for test process to check in..., will wait up to 120s
2014-11-04 11:17:53.334 Adding console adaptor for test process.
2014-11-04 11:17:54.012 Test operation failure: Unable to run app in Simulator
2014-11-04 11:17:54.012 _finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Unable to run app in Simulator" UserInfo=0x7fcb28ddd570 {NSLocalizedDescription=Unable to run app in Simulator} didCancel: 1
...
它起作用了。了解TeamCity构建代理失败的原因吗?根据TeamCity的,有两种方法可以在OS X上创建构建代理守护程序:
- 系统范围:
/Library/LaunchDaemons/jetbrains.teamcity.BuildAgent.plist
- 用户特定:
~/Library/LaunchAgents/jetbrains.teamcity.BuildAgent.plist
$ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Foobar/Foobar.xcodeproj -scheme foobarNightly SYMROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build OBJROOT=/Users/Me/buildAgent/work/e60c5dca158b2d23/Foobar/build test -sdk iphonesimulator8.1
$ sh buildAgent/bin/agent.sh start
TeamCity构建代理将能够启动模拟器。要在启动时运行此脚本,请使用Automator创建一个
.app
:好的,看起来我们已经解决了真正的问题。TeamCity提供的plist
文件包含SessionCreate
属性,最新Mac OS X版本不应包含该属性
这个问题应该在TeamCity 9.0.4中解决,但作为一种解决方法,您应该将jetbrains.TeamCity.BuildAgent.plist
放在
~/Library/LaunchAgents/jetbrains.teamcity.BuildAgent.plist
并从中删除SessionCreate
属性和值
jetbrains.teamcity.BuildAgent.plist文件的当前变体为:
工作目录
/agent/home/directory
调试
标签
jetbrains.teamcity.BuildAgent
OnDemand
持久连接
程序参数
猛击
--登录
-c
启动器/bin/TeamCityAgentService-macosx-universal-32-c../conf/wrapper.conf
运行负荷
标准错误路径
日志/launchd.err.log
标准门诊
日志/launchd.out.log
有人知道为什么会这样吗?