README.md in snapshot-0.8.0 vs README.md in snapshot-0.9.0

- old
+ new

@@ -223,10 +223,12 @@ js_file './path/file.js' ``` You can add a custom script for iPads: `./path/file-iPad.js` and it will automatically be used if found. Just append the `-iPad` to your existing file. +If you want to overwrite the JS path using environment variables, use `SNAPSHOT_JS_FILE`. + ### Scheme To not be asked which scheme to use, just set it like this: ```ruby scheme "Name" ``` @@ -250,21 +252,37 @@ ```ruby ios_version "9.0" ``` +### HTML Title + +If you want to change the title of the generated HTML page, you can use: + +```ruby +html_title 'Example' +``` + ### Custom Args for the build command Use the ```custom_args``` directive to prepend custom statements to the build command. Add a ```custom_build_args``` line to your ```Snapfile``` to add custom arguments to the build command. -Here is an example for adding a preprocessor macro `SNAPSHOT` and a custom build setting `SNAPSHOT_ENABLE`. +Here is an example for adding a preprocessor macro `SNAPSHOT`: ```ruby -custom_build_args "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) SNAPSHOT=1' SNAPSHOT_ENABLE = YES" +custom_build_args "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) SNAPSHOT=1'" ``` +In your Objective-C code, use the following code to detect the `snapshot` mode: + +```objective-c +#ifdef SNAPSHOT +// Your Code here +#endif +``` + ### Custom Args for the run command Add a ```custom_run_args``` line to your ```Snapfile``` to add custom arguments to the run command (i.e. the invocation of `instruments`. You can use this to set the value of a specific `NSUserDefaults` key, for example ```ruby custom_run_args "-DidViewOnboarding YES" @@ -284,10 +302,12 @@ This can be used to - Logout the user - Reset all user defaults - Pre-fill the database +The `setup_for_device_change` will be called **before** the app is installed on the simulator. + To run a shell script, just use ```system('./script.sh')```. ```ruby setup_for_device_change do |device, udid, language| puts "Running #{language} on #{device}" system("./popuplateDatabase.sh") @@ -297,12 +317,10 @@ puts "Finished with #{language} on #{device}" system("./cleanup.sh") end ``` -If you want to run a script before each run of the app, it's enough to only implement the `setup_for_language_change` callback. - ### Skip alpha removal from screenshots In case you want to skip this process, just add ```skip_alpha_removal``` to your ```Snapfile```. ### Pass Bundle Identifier This is only required in case there is a problem automatically detecting it. @@ -343,10 +361,14 @@ - [`cert`](https://github.com/KrauseFx/cert): Automatically create and maintain iOS code signing certificates - [`codes`](https://github.com/KrauseFx/codes): Create promo codes for iOS Apps using the command line ##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx) +## Frame the screenshots + +If you want to add frames around the screenshots and even put a title on top, check out [frameit](https://github.com/fastlane/frameit). + ## Run in Continuous Integration If you want to run `snapshot` on your `Jenkins` machine (or any other CI-system), you might run into an `authorization` popup coming up. You can disable this dialog, running the following command: ``` @@ -402,9 +424,16 @@ Unfortunately, Xamarin command line tool is only available for Business Edition licenses. For Indie licenses you can build the app using Xamarin Studio and use the ```--nobuild``` option. ### Skip building If building via command-line doesn't work for your project or you don't want to build every time, you can run the tool with ```snapshot --nobuild``` to skip the build process and use a pre-built ```.app``` under your ```build_dir```. + +### Simulator doesn't launch the application + +When the app dies directly after the application is launched there might be 2 problems + +- The simulator is somehow in a broken state and you need to re-create it. You can use `snapshot reset_simulators` to reset all simulators (this will remove all installed apps) +- You haven't enabled the correct architectures. Make sure you have the same architectures as in the example project of this repository. ## Determine language in UI Automation script To detect the currently used localization in your Javascript file, use the following code: