clearState
Clear app data, cache, and preferences to reset to fresh install state.
Last updated
Clear app data, cache, and preferences to reset to fresh install state.
Clears all data for a specified mobile application.
To clear the state of the current app, use add the clearState command alone.
- clearStateIf you want to clear the state of a specific app by its ID, add the app ID:
- clearState: app.idOr for a website, when testing on the web platform:
- clearState: https://example.comYou can also add a label when invoking clearState to improve the readability of the report.
- clearState:
appId: app.id
label: Reset ExampleAppThe command's behavior differs based on the mobile operating system.
On Android, the clearState command is equivalent to running:
adb shell pm clear {package name}It removes all app-related data from the device, such as shared preferences, databases, and accounts.
On iOS, the clearState command causes Maestro to reinstall the entire app, resulting in a completely fresh install and removing all existing data folders.
As described in Stack Overflow discussion, it's also possible to xcrun simctl to perform the same action.
The command clears all browser data (cookies, local storage, etc.) for the origin of the current web app, or of the provided web app URL.
Last updated