如何在具有ADB界面的Android手机上禁用应用程序? [英] How to disable applications on an Android phone with ADB interface?

查看:614
本文介绍了如何在具有ADB界面的Android手机上禁用应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用Android手机上的所有USER应用程序。逐一禁用所有这些应用程序将花费一些时间。我可以通过ADB Shell接口使用命令来禁用它们吗?

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?

推荐答案

此命令应在所有Android版本上都可以使用(但我没有比5.1更旧的东西可以进行测试):

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"

在Android 7.0以上版本中,您可以使用速度稍微快一点:

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"

转义在Linux / macOS下运行命令时, $ 使用'而不是

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

这篇关于如何在具有ADB界面的Android手机上禁用应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆