Appearance
adb uninstall: remove apps and find package names
In short: adb uninstall removes an app from a connected Android phone by its package name, such as com.example.app. Add -k to keep the app's data and cache. To find the name, run adb shell pm list packages, with -3 for apps you installed or a word to search for. System apps can be removed for one user with pm uninstall --user 0.
adb works with package names, not the names on the home screen, so the first step is often finding the name.
Syntax
bash
adb uninstall [-k] com.example.app
adb shell pm uninstall [-k] [--user 0] com.example.app
adb shell pm list packages [-3] [-f] [filter]| Command or option | What it does |
|---|---|
adb uninstall com.example.app | Removes the app and its data |
-k | Keeps the app's data and cache on the phone |
pm uninstall --user 0 | Removes an app for the current user only; used for preinstalled apps |
pm list packages | Lists installed packages; -3 only apps you installed, -f with each APK's path, a word to filter |
pm path com.example.app | Shows where the app's APK files are on the phone |
Find the package name
bash
# Every app you installed
adb shell pm list packages -3
# Search for a word in package names
adb shell pm list packages chrome
# The app on screen right now: the line names its package and activity
adb shell dumpsys window | grep mCurrentFocusIn PowerShell, use Select-String mCurrentFocus instead of grep mCurrentFocus.
Remove preinstalled apps
Apps that came with the phone usually refuse adb uninstall. You can remove them for the current user, and get them back later:
bash
adb shell pm uninstall --user 0 com.example.bloat
adb shell cmd package install-existing com.example.bloatThe app stays in the system image, so a factory reset restores it. Some preinstalled apps are needed by others, so look up what an app does before removing it, and prefer turning it off in Settings when that is enough.
On many phones at once
bash
for s in $(adb devices | awk 'NR>1 && $2=="device" {print $1}'); do
adb -s "$s" uninstall com.example.app
donepowershell
adb devices | Select-Object -Skip 1 | ForEach-Object {
$serial, $state = $_ -split '\s+'
if ($state -eq 'device') { adb -s $serial uninstall com.example.app }
}A phone that does not have the app answers with a failure and the loop carries on. In BenchFleet, each phone's page lists its apps and removes them with a click, on every plan, and shows every connected phone on one screen.
Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.
Common errors and fixes
| Error | What it means | Fix |
|---|---|---|
Failure [DELETE_FAILED_INTERNAL_ERROR] | The app is part of the phone's system | Use adb shell pm uninstall --user 0 with the package name |
Unknown package or not installed for 0 | The name is wrong, or the app is not installed for this user | Copy the exact name from pm list packages |
Failure [DELETE_FAILED_DEVICE_POLICY_MANAGER] | The app is a device administrator | Remove its admin rights in the phone's security settings, then uninstall |
adb: more than one device/emulator | Several phones are connected | Choose one with -s and its serial number |
Related
- adb install: put the app back, or install a new build.
- adb shell: force-stop an app or clear its data instead of removing it.
- adb devices: when adb cannot see the phone.
- All ADB commands and the ADB command builder.
Questions
How do I find an app's package name?
Run adb shell pm list packages and look for the app; add -3 to list only apps you installed, or a word such as chrome to search. Each line starts with the word package and then the name. The app's page on Google Play shows it in the address too, after id=.
Does adb uninstall delete the app's data?
Yes, unless you add -k, which keeps the data and cache on the phone. Kept data can only be used again by the same app signed with the same key.
Can I uninstall system apps with ADB?
You can remove a preinstalled app for the current user with adb shell pm uninstall --user 0 and its package name. It stays in the phone's system image, so a factory reset brings it back. Removing the wrong system app can break features, so check what an app does first.
How do I get back a system app I removed?
Run adb shell cmd package install-existing with its package name. That reinstalls it for the current user from the copy still in the system image.
Why does adb uninstall say Unknown package?
The package name is wrong or the app is not installed for the current user. Copy the exact name from adb shell pm list packages; names are case-sensitive.
Start with the Free plan
Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.
- A full refund within 14 days of your first payment
- Starts in Local mode, with no telemetry or analytics
- Made by WOODCOMMERCE LTD, a company registered in the UK