iOS - 如何在fastlane snapshot

时间:2017-03-16 04:41:59

标签: xcodebuild fastlane fastlane-snapshot

我正在使用fastlane快照工具拍摄应用程序屏幕的快照。

根据fastlane社区的说法,我需要跑步,

fastlane snapshot init

然后在配置项目ui测试目标后,我需要运行

fastlane snapshot

但是如果我想提供一些构建参数,比如xcodebuild test test-only 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或   '{'或'('only-testing:TestBundleB / TestSuiteB

我该如何解决这个错误?

1 个答案:

答案 0 :(得分:3)

我不熟悉从命令行运行快照,所以如果可以,我建议创建一个fastlane / Fastfile(或者如果它已经存在则编辑它),以便有一个调用snapshot的通道您正在寻找的选项。您可以使用各种参数调用它,如docs

中所述

该示例显示了如何调用snapshot,而Parameters表描述了可以传递给fastlane Action的其他参数。

要通过Snapfile传递xcargs,请在Snapfile中尝试xcargs "-only-testing:TestBundleB/TestSuiteB"。请参阅此Issue