iOS Simulator: Erase
ios_simulator_eraseRestore a simulator to factory state by deleting installed apps, app data, keychain, and permissions, then reboot it so you can test a genuine first launch.
Instructions
Wipe a simulator back to a factory state: installed apps, their data, the keychain and every granted permission. The only irreversible tool here, and the reason it is the only one behind confirm. Use it to test a genuine first launch. A booted simulator is shut down first and booted again afterwards, because simctl refuses to erase a running one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | Which simulator: its UDID or its name as shown by ios_simulator_list. Omit it when exactly one is booted — that is the normal case, and IOS_SIMULATOR_ID pins it when it is not. Unlike simctl's own `booted`, this never picks arbitrarily between two. | |
| confirm | Yes | Must be true. Explicit acknowledgement that this changes state on a real simulator. |