5

How to clear all allowed permissions on Android Marshmallow? This need for developing and testing.

I know, that I can do it manually, but I want to do this in programmatically way.

Floern
  • 31,495
  • 23
  • 98
  • 115
Sirelon
  • 4,236
  • 3
  • 17
  • 26
  • 3
    I am not sure that there is an option for all permissions. Individually, use `adb shell pm revoke`, such as `adb shell pm revoke com.commonsware.android.perm.tutorial android.permission.CAMERA`. You could always write a Gradle task or other script that examines the merged manifest/`aapt dump badging` output, finds the `dangerous` permissions, and then runs `adb shell pm revoke` for each. – CommonsWare Feb 19 '16 at 13:47
  • 1
    Thank you. Command adb shell pm revoke com.application android.permission.CAMERA is very useful. But I cannot execute comandLine in the gradle :( Task is working, but commandLine with that args wont to work commandLine 'adb', 'shell', 'pm', 'revoke', 'com.application', 'android.permission.CAMERA' I tried to set full path to adb, but that not work too. Otherwise, very Thank you for this command. I executed it in the Android Sudio terminal and it that, what I needed. – Sirelon Feb 19 '16 at 14:57
  • 1
    Possible duplicate of [How to debug Android 6.0 permissions?](http://stackoverflow.com/questions/34512880/how-to-debug-android-6-0-permissions) – Rolf ツ Sep 02 '16 at 12:57

1 Answers1

12

I found answer :-)

Command

adb shell pm reset-permissions
Sirelon
  • 4,236
  • 3
  • 17
  • 26