2016-11-10 122 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