2017-03-16 88 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 –