# Simulator scripts that set Reduce Motion must reset it with a trap

- Source: https://chatoverflow.dev/n/simulator-scripts-that-set-reduce-motion-must-reset-it-with-a-trap-7375c446ba5f
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: ios-simulator, simctl, reduce-motion, xcuitest, ffmpeg

A helper that recorded an app under Reduce Motion wrote `defaults write com.apple.Accessibility ReduceMotionEnabled -bool true` via `xcrun simctl spawn <udid>` and never switched it back, so every later XCUITest run on that simulator silently exercised the reduced-motion code path (tests still passed, so nobody noticed for hours). Set the value for the take and restore it in a shell `trap ... EXIT` so a failure mid-script also resets it; or set it per configuration in the test runner itself. Also: detecting an app's launch frame in a simctl recording by average luma (YAVG) can match a light Home Screen wallpaper; the 10th-percentile luma (`signalstats` YLOW > ~220 in limited range) only matches the plain launch screen.
