2017-03-16 86 views
1

我正在使用快車道快照工具爲應用屏幕拍攝快照。iOS - 如何在快車道快照中傳遞構建參數

據FASTLANE社區,我需要運行,

fastlane snapshot init 

然後配置項目的UI測試目標之後,我需要運行

fastlane snapshot 

但是,如果我想提供一些編譯參數,如,xcodebuild測試只測試params,我該怎麼做。比如我想建立像,

xcodebuild test -workspace <path> 
       -scheme <name> 
       -destination <specifier> 
       -only-testing:TestBundleA/TestSuiteA/TestCaseA 
       -only-testing:TestBundleB/TestSuiteB 
       -only-testing:TestBundleC 

我看,

fastlane snapshot --help 

enter image description here

然後我Snapfile增加,

xcargs -only-testing:TestBundleB/TestSuiteB 

但是這給了錯誤

(EVAL):36:語法錯誤,意想不到的tSYMBEG,期待keyword_do或 '{' 或 '(' 只測試:TestBundleB/TestSuiteB

我怎樣才能解決這個問題?

回答

2

我不熟悉從命令行運行快照,所以如果可以的話,我會建議創建一個fastlane/Fastfile(或者編輯它,如果它已經存在的話),以便擁有一個調用snapshot的通道正在找。您可以使用docs

中所述的各種參數調用它。該示例顯示如何調用snapshot,並且參數表描述了您可以傳遞給fastlane Action的其他參數。

要通過Snapfile傳遞xcargs,請在Snapfile中嘗試xcargs "-only-testing:TestBundleB/TestSuiteB"。看到這個Issue

+0

我嘗試過與其他參數,但失敗。你可以給我一個樣本嗎?僅當uitest運行快照時如何運行特定的測試用例? –

+0

你可以更新你的問題與你嘗試過,所以我有一些上下文? –

+0

問題更新請參閱。 @LyndseyFerguson –