adb指令禁用软件_如何在具有ADB界面的Android手机上禁用应用程序?

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-22 19:15   281   0

I would like to disable all USER applications on an Android phone. Disabling all these applications one by one will take some time. Is there a command I can use via the ADB shell interface to disable them?

解决方案

This command should work on all Android versions (but I do not have anything older than 5.1 to test with):

adb shell "for p in $(pm list packages -3); do pm disable ${p:8}; done"

On Android 7.0+ you could use slightly faster:

adb shell "for p in $(cmd package list packages -3); do pm disable ${p:8}; done"

And if disabling the package is not enough - you can uninstall it with:

adb shell "for p in $(cmd package list packages -3); do pm uninstall ${p:8}; done"

To escape the $ when running the commands under Linux/macOS use ' instead of ".

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP