2015-09-27 40 views
5

玩iOS 9.0,Xcode GM和新的Xcuitesting框架。我如何從命令行運行特定的測試,而不必在ide中單擊播放?我知道有一個運行所有測試的捷徑,但我想運行一個測試。你能從命令行運行一個特定的Xcuitest嗎?

謝謝!

+0

東西有關這個問題的新內容我有同樣的問題:http://stackoverflow.com/questions/34793731/xcode-ui-test-can-i-specify-a-particular-test-that-i-want-to-run-from-terminal – emoleumassi

回答

3

你應該能夠做到這一點與xctool命令行工具來運行特定的測試類,

xctool -workspace YourWorkspace.xcworkspace -scheme YourScheme test -only myUITestTarget:UITestClass 

您還可以使用xcodebuild按此處的說明來運行整個測試套件, https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line

+1

是否適用於XCode-UI-Test?我試過了,但是我有這個錯誤:[Info]加載方案'....'的設置...錯誤:build-tests:'XTests'不是此方案中的測試目標。 – emoleumassi

+1

根據這個問題'xctool'不支持UI測試:https://github.com/facebook/xctool/issues/534。 – brigadir

相關問題