README.md in snapshot-1.10.0 vs README.md in snapshot-1.11.0
- old
+ new
@@ -247,11 +247,11 @@
"de-DE",
"es-ES",
["pt", "pt_BR"] # Portuguese with Brazilian locale
])
-launch_arguments("-username Felix")
+launch_arguments(["-username Felix"])
# The directory in which the screenshots should be stored
output_directory './screenshots'
clear_previous_screenshots true
@@ -284,20 +284,28 @@
to update your `SnapshotHelper.swift` files. In case you modified your `SnapshotHelper.swift` and want to manually update the file, check out [SnapshotHelper.swift](https://github.com/fastlane/snapshot/blob/master/lib/assets/SnapshotHelper.swift).
## 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()`.
+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()`.
+```ruby
+launch_arguments([
+ "-firstName Felix -lastName Krause"
+])
+```
+
+```swift
+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`.
```swift
if NSUserDefaults.standardUserDefaults().boolForKey("FASTLANE_SNAPSHOT") {
// runtime check that we are in snapshot mode
}
-
-username.text = NSUserDefaults.standardUserDefaults().stringForKey("username")
-// username.text = "Felix"
```
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.
```ruby