0

I'm currently using Fastlane to capture screenshots of my application to be used in both the iOS and Android app store. My problem is that Fastlane is only able to capture the loading screen and the username/password authentication screen. Is there a way to pass credentials (possibly test creds with limited access) into Fastlane to allow it to capture other screenshots of my application? If not, what other methods could I use?

Preston Martin
  • 3,288
  • 4
  • 18
  • 39

1 Answers1

1

Please check in Fastlane docs Launch Arguments under Advanced Snapshot section https://docs.fastlane.tools/getting-started/ios/screenshots/ I think it can help

Launch Arguments

You can provide additional arguments to your app on launch. These strings will be available in your app (eg. not in the testing target) through NSProcessInfo.processInfo().arguments. Alternatively, use user-default syntax (-key value) and they will be available as key-value pairs in NSUserDefaults.standardUserDefaults().

launch_arguments([
  "-firstName Felix -lastName Krause"
])

name.text = NSUserDefaults.standardUserDefaults().stringForKey("firstName")
// name.text = "Felix"

snapshot includes -FASTLANE_SNAPSHOT YES, which will set a temporary user default for the key FASTLANE_SNAPSHOT, you may use this to detect when the app is run by snapshot.

if NSUserDefaults.standardUserDefaults().boolForKey("FASTLANE_SNAPSHOT")

{ // runtime check that we are in snapshot mode }

Specify multiple argument strings and snapshot will generate screenshots for each combination of arguments, devices, and languages. This is useful for comparing the same screenshots with different feature flags, dynamic text sizes, and different data sets.

# Snapfile for A/B Test Comparison
launch_arguments([
  "-secretFeatureEnabled YES",
  "-secretFeatureEnabled NO"
])
Dan Cornilescu
  • 6,780
  • 2
  • 21
  • 45
Sinisa Bobic
  • 126
  • 1