Saturday, June 27, 2015

Enable and disable system apps via ADB


Is there any adb command to enable/disable a system app?


Thanks



Answer



Yes. The command is pm disable . 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'
package:com.android.calculator2

Disable app:


root@hammerhead:/ # pm disable com.android.calculator2
Package com.android.calculator2 new state: disabled

List all disabled apps:


root@hammerhead:/ # pm list packages -d
package:com.android.calculator2

package:com.google.android.apps.inputmethod.hindi
package:jp.co.omronsoft.iwnnime.ml
package:com.google.android.inputmethod.pinyin
package:com.google.android.inputmethod.korean
package:com.google.earth
root@hammerhead:/ #

Some other things worth noting:



  1. In my testing, apps disabled in this manner disappear completely from the Settings > Apps list. They do not even seem to be displayed in the "Disabled" tab


  2. You can re-enable apps with pm enable . In fact, this seems to be the only way to re-enable them, in my experience.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...