adb-uninstall
Uninstall application from an Android device
TLDR
Uninstall a package
Uninstall a package, but keep user data
SYNOPSIS
`adb uninstall [-k] <PACKAGE_NAME>`
PARAMETERS
-k
Keeps the data and cache directories of the application after uninstallation. By default, both are removed, but this option preserves user data for reinstallation or analysis.
<PACKAGE_NAME>
The full package name of the application to uninstall (e.g., 'com.android.chrome', 'com.whatsapp'). This is a mandatory argument that uniquely identifies the app.
DESCRIPTION
`adb uninstall` is a powerful subcommand of the Android Debug Bridge (adb) tool, which is an essential component of the Android SDK Platform-Tools. This command allows developers and power users to programmatically remove installed Android application packages (APKs) from a connected Android device or emulator. When executed, `adb uninstall` sends a command to the adbd daemon running on the target Android device, instructing it to remove the specified application. This process typically deletes not only the application's executable files but also its associated data, caches, and user settings, effectively cleaning up the device's storage and user profiles for that app.
The command requires the Android device to be connected to the computer via USB (or wirelessly, if configured) with USB debugging enabled in the device's developer options. It is widely used in app development for quick iterative testing, where applications are frequently installed and removed. Furthermore, it's invaluable for system administrators or advanced users who need to remove bloatware, pre-installed apps (often requiring root access), or simply manage storage on their Android devices. The operation is typically very fast, making it efficient for bulk uninstallation scripts or rapid deployment scenarios.
CAVEATS
Uninstalling system applications or bloatware often requires the device to be rooted, and even then, proceeding with extreme caution is advised as removing critical system components can brick the device. Ensure USB debugging is enabled on the Android device and that the device is properly connected and authorized by the host machine. The package name must be exact; typos will result in a 'Failure [DELETE_FAILED_INTERNAL_ERROR]' or 'Failure [not installed for 0]' message. Uninstallation is permanent for the application's core files and usually its data, unless the `-k` option is used.
HOW TO FIND PACKAGE NAMES
To successfully use `adb uninstall`, you need the exact package name of the application. You can find this using the command `adb shell pm list packages`, which lists all installed packages on the device. To filter the list, you can pipe it to `grep` on your host machine, for example: `adb shell pm list packages | grep 'appname_keyword'`. The output will typically be in the format 'package:com.example.app', where com.example.app is the package name you need.
COMMON ERROR MESSAGES
A common error is 'Failure [not installed for 0]' which usually means the package name provided is incorrect or the app is not installed for the current user profile on the device. 'Failure [DELETE_FAILED_INTERNAL_ERROR]' is a more generic error that can occur for various reasons, including insufficient permissions (e.g., trying to uninstall a system app without root access) or underlying issues with the Android system's package manager. Always double-check the package name, device connection, and necessary permissions.
HISTORY
The `adb uninstall` command has been a fundamental part of the Android Debug Bridge since its inception as a core component of the Android SDK Platform-Tools. Its primary functionality for removing applications has remained largely consistent across various Android versions, reflecting its crucial role in application development and device management. While Android itself has undergone significant evolution, the simplicity and directness of `adb uninstall` have ensured its continued relevance and widespread usage among developers and power users for over a decade.