slimdroid

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 <package> with the app's package name.

Updated

Before you start

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 <package>           # where the APK lives
adb shell pm disable-user --user 0 <package>
adb shell pm enable <package>
adb shell pm uninstall -k --user 0 <package>
adb shell cmd package install-existing <package>

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.

Common errors

MessageUsual causeWhat to try
no devices/emulators foundCable, driver or USB mode.Use a data cable, choose File transfer and replug.
device unauthorizedThe 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 stateThe phone needs an extra setting, common on Xiaomi.Turn on USB debugging (Security settings).
Unknown package or not installed for 0A 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 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.

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.