Uninstall an app
android_uninstallRemove an Android app from a device to resolve installation conflicts or test a clean first-run state. It deletes app data and cache unless keep_data is set.
Instructions
Remove an app from the device. This deletes the app's data and cannot be undone.
Args:
package_name (string, optional): application id to remove
project_path (string, optional): Gradle root; the package is resolved from it when package_name is omitted
module (string): module to read the package from (default: 'app')
serial (string, optional): target device
keep_data (boolean): keep app data and cache directories (adb uninstall -k) (default: false)
Returns: { "uninstalled": boolean, "packageName": string, "serial": string }
Examples:
Use when: an install fails with INSTALL_FAILED_UPDATE_INCOMPATIBLE and the old copy must go
Use when: testing a first-run experience from a clean state
Don't use when: you only want to clear state; force-stopping or clearing data is less destructive
Error Handling:
Reports when the package was not installed to begin with
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| module | No | Gradle module that produces the APK. Almost always 'app'. | app |
| serial | No | Device serial from android_list_devices. Optional when exactly one device is connected; required when several are. | |
| keep_data | No | Retain the app's data and cache directories. | |
| package_name | No | Application id to uninstall. | |
| project_path | No | Gradle root to resolve the package from. |