My notes on automating screenshots for the app store.
⚠️️ This is now outdated, we can use XCodes built in screenshot gallary + a simple snippet that can be found here: https://github.com/eonist/UITestSugar#take-screenshot ⚠️️
The quality of an app’s screenshot is fundamental in the decision of buying / downloading on the AppStore.
Requisites:
- Download and install Fastlane Snapshot for terminal: https://github.com/fastlane/fastlane/releases
- Install brew: https://brew.sh (Needed for imagemagick)
- Install imagemagick Terminal:
brew install imagemagick
(Need for FrameIt ) - Install frameIt:
fastlane frameit
Workflow:
- Add the
Snapfile
to the project root folder - Terminal:
fastlane snapshot
And remember to addsetupSnapshot(app)
just beforeapp.launch
in the UITests - Terminal:
fastlane frameit download_frames
- Terminal:
fastlane framit
orfastlane frameit silver
if you want the white iPhone bezel - Configure the Frameit.conf file. Use the MindNode example from the resource paragraph
- Set the titles to match the .png names in
title.strings
andkeywords.strings
(⚠️️ Edit these .strings files in XCode ⚠️️)
Gotchas:
- To create multiline titles use the newline:
\n
character - Edit the titles.strings file in xcode (other apps breaks the syntax)
- To only add frame with out title, just provide the default fastlane.json
- ⚠️Important: ⚠️If you set the langue to different than english in snapfile, then after you run a snapshot session. This lang will be inherited in xcode simulator. If you use the setupSnapshot method. To roll this back either set the lang to english and run a snapshot session from terminal or comment out the setupSnapshot method.
- ⚠️Important: ⚠️Language will hang in snapshot: if you don’t set the scheme lang back to system lang. Also uncomment setupSnapshot if you did that
Tips:
- To reset all simulators: Terminal:
fastlane snapshot reset_simulators
Resources:
- FrameIt official docs: https://docs.fastlane.tools/actions/frameit/
- FrameIt config file https://github.com/fastlane/examples/tree/master/MindNode/screenshots
- Official doc for Fastlane-Snapshot: https://docs.fastlane.tools/actions/snapshot/
- Precheck official docs: https://docs.fastlane.tools/actions/precheck/
- Great overview of all the Fastlane tools: https://www.raywenderlich.com/233168-fastlane-tutorial-getting-started
- StatusMagic: https://medium.com/@juli1quere/a-perfect-status-bar-on-screenshots-with-fastlane-84a94a350b2a
- Shots is a sketch plugin that helps frame iPhone screens. https://github.com/jtholloran/shots
- CLI and CI screenshots etc: https://rderik.com/blog/understanding-xcuitest-screenshots-and-how-to-access-them/