Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - How to pass build params in fastlane snapshot

I am using fastlane snapshot tool for taking snapshot for app screens.

According to fastlane community, i need to run,

fastlane snapshot init

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

fastlane snapshot

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

I see,

fastlane snapshot --help

enter image description here

Then I added in Snapfile,

xcargs -only-testing:TestBundleB/TestSuiteB

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?

like image 473
Sazzad Hissain Khan Avatar asked Oct 17 '25 08:10

Sazzad Hissain Khan


1 Answers

I am not familiar with running snapshot from the command line, so if you can, I would recommend creating a fastlane/Fastfile (or editing it if it already exists) to have a lane that calls snapshot with the options that you are looking for. You can call it with its various parameters as explained in the docs

The example shows you how snapshot could be called, and the Parameters table describes the other parameters you can pass to the fastlane Action.

To pass xcargs via the Snapfile, try xcargs "-only-testing:TestBundleB/TestSuiteB" in your Snapfile. See this Issue.

like image 188
Lyndsey Ferguson Avatar answered Oct 21 '25 06:10

Lyndsey Ferguson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!