Is there any adb command to enable/disable a system app?
Yes. The command is
pm disable <package name>. You must be root in order to do this:
Open shell and get root:
PC> adb shell
shell@hammerhead:/ $ su
List all enabled apps, filter by "calculator":
root@hammerhead:/ # pm list packages -e | grep 'calculator'
root@hammerhead:/ # pm disable com.android.calculator2
Package com.android.calculator2 new state: disabled
List all disabled apps:
root@hammerhead:/ # pm list packages -d
Some other things worth noting:
pm enable <package name>. In fact, this seems to be the only way to re-enable them, in my experience.
This should work regardless whether the app is a system app or a third-party app (user installed).
adb shell su pm disable PACKAGE # disables the app and hides it in Settings -> Applications pm hide PACKAGE # alternative; for Android Lollipop and above cmd package suspend PACKAGE # alternative; package remains visible in Launcher and Settings app but cannot be used; a feature of Device Administration
PACKAGE refers to package name of the app
To reinstate the app, replace disable with enable, hide with unhide, and suspend with unsuspend in the said command and execute it with root privilege.
If you've Android KitKat or above and do not have root access, use adb in PC to execute this command:
adb shell pm block PACKAGE # for Android KitKat adb shell pm hide PACKAGE # for Android Lollipop only adb shell pm disable-user PACKAGE # alternative to `pm hide`; for Android Lollipop and above; this works just like disabling an app through Settings app
To reinstate the app:
adb shell pm unblock PACKAGE # for Android KitKat adb shell pm unhide PACKAGE # for Android Lollipop and only if you used `pm hide` earlier adb shell pm enable PACKAGE # for Android Lollipop and above
Changes would take place immediately.
Further to the answer by @eldarerathis, you can disable an app for a specific user. I used this method to remove some apps from a restricted user that weren't listed on the user settings screen. All commands from an
adb shell. Root access is required to make the changes.
First, get the user's id:
$ pm list users
$ pm disable --user 11 com.cyanogenmod.filemanager
Package com.cyanogenmod.filemanager new state: disabled-user
# pm enable --user 11 com.cyanogenmod.filemanager
In this example, Alice can use the file manager but Bob cannot.
You can do a similar thing with
hide instead of
disable. I am not sure which is best, but see this answer. The converse of
unhide (a reboot may be needed to effect
You can list packages with
pm list packages --user 11. Give
-e to list enabled packages or
-d if you want to see disabled ones. There would appear to be no filter for hidden packages.
FWIW: I tried the above on Lollipop with CM 12.1 on an Amazon Fire (KFFOWI).
I wanted to disable the playstore on Vivo phone because my niece always installs multiple gigabytes of games. For some of you this might work, no root is required.
To disable playstore:
$ adb shell pm uninstall --user 0 -k com.android.vending
This uninstalls the app. But there's also a way to restore the app:
$ adb shell pm install-existing com.android.vending
Package com.android.vending installed for user: 0
Of course, playstore is an example. This should work for most system apps. From the PC, you can directly run this, or if you're in an ADB shell, run the command after
You can use
adb shell pm list packages, pipe that to grep to search for the package easily.
Note that this uninstalls the app, the -k flag should keep the data. But in my case all data was purged/deleted. So there might be data loss during the process of uninstallation of system apps.