Adb

Android-ADBを介してシステムアプリを有効または無効にします



Android Enable Disable System Apps Via Adb



解決:

はい。コマンドはpmdisable。これを行うには、rootである必要があります。

シェルを開いてルートを取得します。



PC> adb shell [email protected] :/ $ su  

List all enabled apps, filter by 'calculator':

 [email protected] :/ # pm list packages -e | grep 'calculator' package:com.android.calculator2  

Disable app:



 [email protected] :/ # pm disable com.android.calculator2 Package com.android.calculator2 new state: disabled  

List all disabled apps:

 [email protected] :/ # 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 [email protected] :/ #  

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.

This should work regardless whether the app is a system app or a third-party app (user installed).




See my answer at Determine the package name of your app to get the package name of the concerned app and use adb shell to execute these commands ( requires root access ):

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はアプリのパッケージ名を指します

アプリを元に戻すには、 無効にする有効隠れる再表示 、 と つるす一時停止を解除する 上記のコマンドで、root権限で実行します。

Androidキットカット以上をお持ちの場合 ルートアクセス権がありません 、PCでadbを使用して、次のコマンドを実行します。

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 

アプリを復元するには:

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 

変更はすぐに行われます。


@eldarerathisによる回答に加えて、特定のユーザーのアプリを無効にすることができます。この方法を使用して、ユーザー設定画面に表示されていない制限付きユーザーから一部のアプリを削除しました。からのすべてのコマンドadbシェル。変更するにはルートアクセスが必要です。

まず、ユーザーのIDを取得します。

$ pm list usersユーザー:UserInfo {0:Alice:13}実行中UserInfo {11:Bob:18}実行中

それで

$ pm disable --user 11 com.cyanogenmod.filemanagerパッケージcom.cyanogenmod.filemanager新しい状態:disabled-user

再度有効にするには

#pm enable --user 11 com.cyanogenmod.filemanager

この例では、アリスはファイルマネージャーを使用できますが、ボブは使用できません。

あなたはで同様のことをすることができます代わりに非表示無効にします。どちらが最適かはわかりませんが、この回答を参照してください。の逆隠すは再表示(実行するには再起動が必要な場合があります)再表示)。

あなたはでパッケージをリストすることができますpm list packages --user11。与える-e有効なパッケージを一覧表示する、または-無効になっているものを見たい場合はd。非表示のパッケージにはフィルターがないように見えます。

FWIW: Amazon Fire(KFFOWI)のCM12.1を使用してLollipopで上記を試しました。