Description
clearState on iOS simulators requires the --app-file flag and performs a full uninstall + reinstall of the app. Maestro CLI's clearState clears app data in place without uninstalling, so flows that use clearState for fast per-test resets are not portable to maestro-runner without reconfiguration.
Beyond the configuration burden, the reinstall path is fragile: pointing --app-file at the currently-installed .app inside ~/Library/Developer/CoreSimulator/Devices/<UDID>/data/Containers/Bundle/Application/<UUID>/ fails because the simulator container is removed by the uninstall step before the reinstall step runs (lstat ... failed: No such file or directory). Users must keep a separate copy of the .app (e.g. from DerivedData) just to satisfy the reinstall.
Steps to Reproduce
-
Run a flow containing clearState on an iOS simulator without --app-file:
maestro-runner --platform ios --device <UDID> test flow.yaml
appId: com.example.app
---
- clearState
-
The same flow runs cleanly under maestro CLI with no extra config.
Expected Behavior
Either:
clearState clears app data in place (matching Maestro CLI behavior — no --app-file required), or
- The reinstall path is robust to the case where
--app-file points at the live simulator-container path (resolve and cache the .app before uninstall).
A documented option flag (e.g. --clear-state-mode=data|reinstall) would also resolve this.
Actual Behavior
Without --app-file:
✗ clearState (1.0s)
╰─ clearState on iOS requires --app-file for reinstall
Usage: maestro-runner --app-file <path-to-ipa-or-app> --platform ios test <flow-files>
With --app-file pointing at the live simulator-container path:
✗ clearState (2.0s)
╰─ simctl install failed: exit status 2: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Simulator device failed to install the application.
Underlying error (domain=NSPOSIXErrorDomain, code=2):
lstat of /Users/.../CoreSimulator/Devices/<UDID>/data/Containers/Bundle/Application/<UUID>/MyApp.app failed: No such file or directory
(The path is valid before clearState runs; uninstall removes the container, then the reinstall fails.)
With --app-file pointing at a DerivedData .app: works, but adds 1.5–3s per clearState and requires the user to track a separate .app path outside the simulator.
Environment
- OS: macOS 15.0 (Darwin 24.6.0)
- maestro-runner version: 1.1.13 (commit 7addd21)
- WDA version: 12.2.0
- Executor: Native (default WDA driver)
- Device/Simulator: iPhone 16, iOS 18.6 (Simulator)
Additional Context
For projects with many shared setup flows that all call clearState (e.g. Expo apps with per-test seed scripts), this turns "drop in and go" into a meaningful porting effort. The two practical paths today are:
- Keep a built
.app outside the simulator and pass --app-file everywhere.
- Rewrite shared setup flows to drop
clearState and reset state via the backend instead.
A clear-in-place implementation (matching Maestro CLI) would be a much easier migration path.
Description
clearStateon iOS simulators requires the--app-fileflag and performs a full uninstall + reinstall of the app. Maestro CLI'sclearStateclears app data in place without uninstalling, so flows that useclearStatefor fast per-test resets are not portable to maestro-runner without reconfiguration.Beyond the configuration burden, the reinstall path is fragile: pointing
--app-fileat the currently-installed.appinside~/Library/Developer/CoreSimulator/Devices/<UDID>/data/Containers/Bundle/Application/<UUID>/fails because the simulator container is removed by the uninstall step before the reinstall step runs (lstat ... failed: No such file or directory). Users must keep a separate copy of the.app(e.g. from DerivedData) just to satisfy the reinstall.Steps to Reproduce
Run a flow containing
clearStateon an iOS simulator without--app-file:The same flow runs cleanly under
maestroCLI with no extra config.Expected Behavior
Either:
clearStateclears app data in place (matching Maestro CLI behavior — no--app-filerequired), or--app-filepoints at the live simulator-container path (resolve and cache the.appbefore uninstall).A documented option flag (e.g.
--clear-state-mode=data|reinstall) would also resolve this.Actual Behavior
Without
--app-file:With
--app-filepointing at the live simulator-container path:(The path is valid before
clearStateruns; uninstall removes the container, then the reinstall fails.)With
--app-filepointing at a DerivedData.app: works, but adds 1.5–3s perclearStateand requires the user to track a separate.apppath outside the simulator.Environment
Additional Context
For projects with many shared setup flows that all call
clearState(e.g. Expo apps with per-test seed scripts), this turns "drop in and go" into a meaningful porting effort. The two practical paths today are:.appoutside the simulator and pass--app-fileeverywhere.clearStateand reset state via the backend instead.A clear-in-place implementation (matching Maestro CLI) would be a much easier migration path.