iOS - 如何在 fastlane 快照中传递构建参数

Saz*_*han 4 xcodebuild fastlane fastlane-snapshot

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

According to fastlane community, i need to run,

fastlane snapshot init
Run Code Online (Sandbox Code Playgroud)

Then after configuring project ui test target, i need to run

fastlane snapshot
Run Code Online (Sandbox Code Playgroud)

But if I want to provide some build parameters like, xcodebuild test test-only params, how can I do that. For example i want to build like,

xcodebuild test -workspace <path>
                -scheme <name>
                -destination <specifier>
                -only-testing:TestBundleA/TestSuiteA/TestCaseA
                -only-testing:TestBundleB/TestSuiteB
                -only-testing:TestBundleC
Run Code Online (Sandbox Code Playgroud)

I see,

fastlane snapshot --help
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Then I added in Snapfile,

xcargs -only-testing:TestBundleB/TestSuiteB
Run Code Online (Sandbox Code Playgroud)

But this gives error

(eval):36: syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' only-testing:TestBundleB/TestSuiteB

How can i solve this error?

Lyn*_*son 5

我不熟悉从命令行运行快照,所以如果可以的话,我建议创建一个 fastlane/Fastfile (或编辑它,如果它已经存在)以拥有一个调用snapshot您正在寻找的选项的通道。您可以按照文档中的说明使用其各种参数来调用它

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

xcargs通过 Snapfile 传递,请尝试xcargs "-only-testing:TestBundleB/TestSuiteB"输入您的 Snapfile。请参阅本期