Skip to main content

Capturing Screenshots

Capture App Store screenshots directly from iOS/iPadOS simulators using UI tests. Replaces fastlane snapshot.

Quick start

ascelerate screenshot init                  # Create config and helper in ascelerate/
ascelerate screenshot # Capture screenshots

Commands

Run

ascelerate screenshot                       # Capture screenshots
ascelerate screenshot run # Same as above

Always uses ascelerate/screenshot.yml in the current directory.

Init

ascelerate screenshot init

Creates both ascelerate/screenshot.yml and ascelerate/ScreenshotHelper.swift in the ascelerate/ directory. Prompts for confirmation before writing. Won't overwrite existing files.

Create helper

ascelerate screenshot create-helper         # Generates ScreenshotHelper.swift
ascelerate screenshot create-helper -o CustomHelper.swift

Config (ascelerate/screenshot.yml)

workspace: MyApp.xcworkspace
# project: MyApp.xcodeproj # Use project instead of workspace
scheme: AppUITests
devices:
- simulator: iPhone 16 Pro Max
- simulator: iPad Pro 13-inch (M4)
languages:
- en-US
- de-DE
outputDirectory: ./screenshots
clearPreviousScreenshots: true
eraseSimulator: false
localizeSimulator: true
overrideStatusBar: true
darkMode: false
disableAnimations: true
waitAfterBoot: 0
# statusBarArguments: "--time '9:41' --dataNetwork wifi"
# testWithoutBuilding: true # Skip build, use existing xctestrun
# cleanBuild: false
# headless: false # Don't open Simulator.app
# helperPath: AppUITests/ScreenshotHelper.swift
# launchArguments:
# - -ui_testing
# configuration: Debug # Build configuration
# testplan: MyTestPlan # Xcode test plan name
# numberOfRetries: 0 # Retry failed tests
# stopAfterFirstError: false # Stop all devices on first failure
# reinstallApp: false # Delete and reinstall app before tests
# xcargs: SWIFT_ACTIVE_COMPILATION_CONDITIONS=SCREENSHOTS

UITest usage

Add ScreenshotHelper.swift to your UITest target:

override func setUp() {
setupScreenshots(app)
app.launch()
}

func testScreenshots() {
screenshot("01-home")
app.buttons["Settings"].tap()
screenshot("02-settings")
}

Your app can detect screenshot mode via:

if ProcessInfo.processInfo.arguments.contains("-ASC_SCREENSHOT") {
// Show demo data, hide debug UI, etc.
}

The helper also provides disableAnimationsIfNeeded() to turn off animations when disableAnimations is enabled in the config:

override func setUp() {
setupScreenshots(app)
disableAnimationsIfNeeded()
app.launch()
}

How it works

  1. Builds once with build-for-testing (or skips if testWithoutBuilding: true)
  2. For each language: boots all simulators, localizes, overrides status bar
  3. Runs tests concurrently across devices
  4. Collects screenshots from per-device cache to output directory
  5. Errors skip and continue — error logs saved to output

Output

screenshots/
├── en-US/
│ ├── iPhone 16 Pro Max-01-home.png
│ ├── iPhone 16 Pro Max-02-settings.png
│ └── iPad Pro 13-inch (M4)-01-home.png
└── de-DE/
└── ...

Options

OptionDescription
clearPreviousScreenshotsClear language folder before collecting (only if all devices succeed)
eraseSimulatorErase simulator before each language
localizeSimulatorSet simulator language/locale per language
overrideStatusBarOverride status bar (9:41, full bars, Wi-Fi)
statusBarArgumentsCustom xcrun simctl status_bar arguments
darkModeEnable dark mode on simulators
disableAnimationsDisable animations during tests
waitAfterBootSeconds to wait after simulator boot (default: 0)
testWithoutBuildingSkip build, use existing xctestrun file
cleanBuildRun clean before building
headlessDon't open Simulator.app
helperPathPath to ScreenshotHelper.swift for version checking
launchArgumentsExtra launch arguments passed to the app
configurationBuild configuration (e.g. Debug, Release)
testplanXcode test plan name
numberOfRetriesNumber of times to retry failed tests
stopAfterFirstErrorStop all devices after the first failure
reinstallAppDelete and reinstall the app before running tests
xcargsExtra arguments passed to xcodebuild