androidpermissionsadbandroid-permissionsaapt

Listing permissions of Android application via adb


Using adb, how can I find out the which permissions an Android application requires?

Because I want to display the permissions of multiple applications on different devices, viewing them in Google Play or Settings > Applications manager requires too much manual work.


Solution

  • I just wanted to combine Jason's and Juuso's answers together and notice that the former lists permissions that were granted, while the latter lists permissions that were requested (including ones that were granted).

    To see only permissions that were granted (but omitting ones that were requested but not granted) use

    adb shell dumpsys package packagename
    

    and check grantedPermissions section at the bottom of the output.

    To list all permissions (requested but not granted + requested and granted):

    1. Notice the APK of a package. You can run the same command

      adb shell dumpsys package packagename
      

      and get the APK path from codePath element of its output.

    2. (if there is no aapt on your device/emulator) You'll need to pull the apk from device/emulator as Juuso Ohtonen has pointed out in his answer. So execute something like this from your desktop:

      adb pull /data/app/com.your.package.apk
      
    3. List all permissions of the package

      If missing from device/emulator aapt can be found under build-tools/<version>/ in your Android SDK.

      Then execute

      aapt d permissions /path/to/com.your.package.apk