2016-11-10 119 views
2

我试图用jenkins自动化我的iOS项目。 但是我遇到了我想用jenkins测试的项目的一个问题。单元测试iOS与Jenkins

该项目命名为ttt并且正在使用cocoapods,因此它也有一个名为ttt的工作区。

看看这些方案,项目中存在以下内容。 enter image description here

我跟着this教程。是

我做如下设置 enter image description here

enter image description here

enter image description here

当我尝试运行它,它会卡住就在这里!

Going to invoke xcodebuild:, scheme: ttt, sdk: DEFAULT, workspace: ttt, configuration: Debug, clean: NO, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT 
[lbp-iOS] $ /usr/bin/xcodebuild -scheme ttt -workspace ttt.xcworkspace -configuration Debug build test -destination "platform=iOS Simulator,name=iPhone 6,OS=10.1" 

当我从工作区字段中删除ttt我收到以下错误

Going to invoke xcodebuild:, scheme: ttt, sdk: DEFAULT, project: DEFAULT, configuration: Debug, clean: NO, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT 
[lbp-iOS] $ /usr/bin/xcodebuild -scheme ttt -configuration Debug build 
xcodebuild: error: The project named "ttt" does not contain a scheme named "ttt". The "-list" option can be used to find the names of the schemes in the project. 
Build step 'Xcode' marked build as failure 
Recording test results 
+0

你是什么意思“卡住”?它只是坐在那个'去调用xcodebuild ...'行永远吗? – kpsharp

+0

@kpsharp是啊,它只是坐在那里。我已经让它跑了30分钟,但它不会从这一点移动。我宁愿看到一个错误,然后诚实地大声笑 – NoSixties

+0

那么这可能是Xcode集成插件的问题。你可以联系他们试图修复它。或者,您可以编写bash脚本来运行与Xcode打包在一起的Xcode命令行工具,并将其作为Jenkins计划的一部分运行。 – kpsharp

回答

2

好吧,为什么它不工作了的事实,该计划实际上并没有做派去玩。 您需要在xcode项目中指定它,否则它甚至不会显示为您可以提交的文件。

要做到这一点去xcode > Product > Scheme > Manage Schemes
你会看到一个屏幕,在项目中的所有方案,确保你打勾Shared下的方框全部要在詹金斯使用这样的方案。

enter image description here

推给你的git的并再次尝试。它现在应该工作。

+0

这没有办法。多谢! – greg

+0

@greg没问题,很高兴它的工作。我建议你看看fastlane,这正是我目前使用的集成在jenkins of course中的东西 – NoSixties