far*_*seb 8 testing teamcity xcode continuous-integration ios
我正在尝试使用TeamCity创建一个简单的Xcode项目.没有运行任何测试我成功了.
我在Swift中有一个基本的单视图应用程序,屏幕上有一个标签.TeamCity(9.0.2)和Xcode(6.1.1)都运行在安装了OS X(10.10.2)服务器(4.0.3)的同一台机器(Mac mini)上.我已经使用Server创建了一个Git存储库,并将其作为远程添加到我的示例Xcode项目中.之后,我成功创建了一个有效的TeamCity项目和构建.
但是,当我尝试检查运行测试复选标记时,无论我做什么,构建都会失败.
配置(保管箱图像) https://dl.dropboxusercontent.com/u/55101816/Screen%20Shot%202015-03-01%20at%2002.45.48.png
错误消息(以及之前的消息)
[02:31:48][FirstTeamCityProjectTests (BUILD)] Touch
[02:31:48][Touch] Touch build/Debug-iphoneos/FirstTeamCityProjectTests.xctest
[02:31:48][Touch] cd /Library/TeamCity/buildAgent/work/55b27ad210b8fe77
[02:31:48][Touch] export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/> ontents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin"
[02:31:48][Touch] /usr/bin/touch -c /Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build/Debug-iphoneos/FirstTeamCityProjectTests.xctest
[02:31:48][FirstTeamCityProjectTests (BUILD)] CodeSign
[02:31:48][CodeSign] CodeSign build/Debug-iphoneos/FirstTeamCityProjectTests.xctest
[02:31:48][CodeSign] cd /Library/TeamCity/buildAgent/work/55b27ad210b8fe77
[02:31:48][CodeSign] export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
[02:31:48][CodeSign] export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/ Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin"
[02:31:48][CodeSign] Signing Identity: "iPhone Developer: *"
[02:31:48][CodeSign] /usr/bin/codesign --force --sign * /Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build/Debug-iphoneos/FirstTeamCityProjectTests.xctest
[02:31:48][Step 1/1] ** BUILD SUCCEEDED **
[02:31:48][Step 1/1] xcodebuild: error: Failed to build workspace FirstTeamCityProject with scheme FirstTeamCityProject.
[02:31:48][Step 1/1] Reason: Xcode cannot run using the selected device.
[02:31:48][Step 1/1] Process exited with code 70
[02:31:48][Step 1/1] Step Xcode Project failed
Run Code Online (Sandbox Code Playgroud)
我发现这个错误代码和CI的主要问题是他们尝试使用ssh并且没有GUI会话.目前我与它使用的用户有一个有效的GUI会话,所以它应该不是问题.
xcodebuild命令如下.
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace FirstTeamCityProject.xcodeproj/project.xcworkspace -scheme FirstTeamCityProject SYMROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build OBJROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build clean build test
Run Code Online (Sandbox Code Playgroud)
这里缺少的(我想)是一个或多个目的地.我执行了以下命令,它运行得很好.(打开模拟器,然后成功退出.)
xcodebuild test -project FirstTeamCityProject.xcodeproj -scheme FirstTeamCityProject -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1'
Run Code Online (Sandbox Code Playgroud)
我似乎对这个问题一个人,我没有找到任何其他相关的命中.看看这个教程:http://pivotallabs.com/ios-continuous-deployment-teamcity-hockeyapp/,我的问题根本不存在.
编辑: 目的地确实缺失,但我不明白为什么.此外,如果我尝试手动添加它,则构建失败.(我怀疑参数的顺序很重要,但我怎么能在TeamCity的其他地方添加这个目的地.)
[01:48:12][Step 1/1] Building project: /Library/TeamCity/buildAgent/work/55b27ad210b8fe77/FirstTeamCityProject.xcodeproj
[01:48:12][Step 1/1] Using Xcode 6.1.1
[01:48:12][Step 1/1] Starting: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace FirstTeamCityProject.xcodeproj/project.xcworkspace -scheme FirstTeamCityProject SYMROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build OBJROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build clean build test -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1'
[01:48:12][Step 1/1] in directory: /Library/TeamCity/buildAgent/work/55b27ad210b8fe77
[01:48:12][Step 1/1] xcodebuild: error: option 'Destination' requires at least one parameter of the form 'key=value'
Run Code Online (Sandbox Code Playgroud)
我很感激你的想法!提前致谢!
小智 5
在团队城市中,当您配置"Xcode项目"构建步骤时,在"其他命令行参数"输入框中添加目标参数,如下所示:
"-destination" "platform=iOS Simulator,name=iPhone 6,OS=8.4"
Run Code Online (Sandbox Code Playgroud)
注意引号
这解决了我的问题(我在TeamCity Professional 9.1.5(build 37377)上查看过).
归档时间: |
|
查看次数: |
2235 次 |
最近记录: |