# ADB commands to debloat Android Five ADB commands cover debloating without root: `pm list packages` finds apps, `pm disable-user --user 0` switches one off, `pm uninstall -k --user 0` removes it for your user, `pm enable` turns it back on and `cmd package install-existing` restores a removed one. Replace `` with the app's package name. ## Before you start - Install Android platform-tools on the computer. - [Turn on USB debugging](https://slimdroid.com/guides/enable-usb-debugging) and plug in the phone. - Run `adb devices`. The phone should be listed as `device`, not `unauthorized`. ## The commands ``` adb devices adb shell pm list packages # every package adb shell pm list packages -3 # apps you installed adb shell pm list packages -s # system apps adb shell pm list packages -d # disabled apps adb shell pm path # where the APK lives adb shell pm disable-user --user 0 adb shell pm enable adb shell pm uninstall -k --user 0 adb shell cmd package install-existing ``` Search the package list for a name: `adb shell pm list packages | findstr samsung` on Windows, or `| grep samsung` on macOS and Linux. ## Disable or uninstall? `--user 0` means the primary user. Work profiles and guest accounts use other user IDs and are not changed. `-k` keeps the app's data and cache. With `--user 0` the APK stays on the system partition, which is why `install-existing` can bring the app back. Start with disable; [here is the difference](https://slimdroid.com/guides/debloat-android-without-root). ## Common errors | Message | Usual cause | What to try | | --- | --- | --- | | `no devices/emulators found` | Cable, driver or USB mode. | Use a data cable, choose File transfer and replug. | | `device unauthorized` | The Allow prompt was not accepted. | Unlock the phone, replug and tap **Allow**. | | `Failure [DELETE_FAILED_INTERNAL_ERROR]` | The package is protected or cannot be removed for the user. | Try `pm disable-user` instead, or leave it alone. | | `Shell cannot change component state` | The phone needs an extra setting, common on Xiaomi. | Turn on **USB debugging (Security settings)**. | | `Unknown package` or `not installed for 0` | A typo, or already removed for this user. | Check the name with `pm list packages`. | ## Why use a tool instead Typing names from a random list is how people break a phone. The [slimdroid tool](https://slimdroid.com/app) explains each package, protects critical ones, reads the state back from the phone after each command and keeps an undo journal. See [Android debloat tools compared](https://slimdroid.com/guides/debloat-tools-compared). ### What does --user 0 mean in ADB? It targets user 0, the primary user of the phone. Work profiles and guest users have other IDs, so a command with `--user 0` leaves them unchanged. ### Does pm uninstall -k delete the app? Not from the system. `-k` keeps data and cache, and with `--user 0` the APK stays on the system partition. The app disappears for your user and can be restored with `cmd package install-existing`. ### Do these commands need root? No. They run as the ADB shell user, which is allowed to manage packages for the primary user. ## Related guides - [How to debloat an Android phone without root](https://slimdroid.com/guides/debloat-android-without-root) - [How to enable USB debugging on Android](https://slimdroid.com/guides/enable-usb-debugging) - [Android debloat tools compared](https://slimdroid.com/guides/debloat-tools-compared)