使用adb授予/撤消权限

使用adb授予/撤消权限

问题描述:

Android文档包含对adb grant和adb吊销命令的以下描述.

The Android documentation contains the following description of the adb grant and adb revoke commands.

使用adb工具从命令行管理权限:列表 权限和状态(按组):$ adb shell pm list permissions -d -g 授予或撤消一个或多个权限:$ adb shell pm [grant|revoke] <permission-name> ...分析您的应用程序以使用哪些服务 权限.

Use the adb tool to manage permissions from the command line: List permissions and status by group: $ adb shell pm list permissions -d -g Grant or revoke one or more permissions: $ adb shell pm [grant|revoke] <permission-name> ...Analyze your app for services that use permissions.

我运行此命令,没有任何错误消息:

i run this command, without any error message:

abd shell pm [grant|revoke] com.my.app android.permission.ACCESS_FINE_LOCATION

如果我打开设置->应用程序-> myapp->权限. 我看不到任何变化...

If i open settings -> apps -> myapp -> Permissions. i dont see any changes...

我怎么知道我的adb命令是否有效?为什么应用程序的设置没有任何变化?

How i know if my adb command works? Why there is no any change in the settings of app?

您正在执行以下操作:

abd shell pm [grant|revoke] com.my.app android.permission.ACCESS_FINE_LOCATION

对于 Android调试桥,它应该为 adb .即

adb shell pm [grant|revoke] com.my.app android.permission.ACCESS_FINE_LOCATION