首页 > 解决方案 > 是否有 ADB 命令可以更改已安装应用程序的高级设置?

问题描述

我一直试图找出一个使用 ADB 命令行的命令来更改我通过 ADB 安装的应用程序的高级设置。

安装后,我希望使用 ADB 命令将以下设置更改为“允许”:

在此处输入图像描述

这可能吗?

我想可能是:在这里找到
adb shell pm grant com.mycompany.mypackage INSTALL_NON_MARKET_APPS 1

标签: androidcommand-linepermissionsadb

解决方案


安装未知应用程序的命令是:

adb shell pm grant com.company.testapp  android.permission.REQUEST_INSTALL_PACKAGES

这将失败,因为android.permission.REQUEST_INSTALL_PACKAGES不是可更改的权限类型:

Operation not allowed: java.lang.SecurityException: Permission android.permission.REQUEST_INSTALL_PACKAGES is not a changeable permission type

也许有一种方法可以解决这个问题,我不知道。


推荐阅读