Listing permissions of Android application via adb

AndroidPermissionsAdbAndroid PermissionsAapt

Android Problem Overview


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.

Android Solutions


Solution 1 - Android

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
    

Solution 2 - Android

  1. List all applications along with their installation paths (use -3 flag if you're only interested in 3rd party apps). As an example, let's try to find out YouTube app permissions.
    adb shell pm list packages -f

    Output: > ...
    > package:/data/app/com.google.android.youtube-1.apk=com.google.android.youtube >
    ...

  2. Pull the selected apk from the device:
    adb pull /data/app/com.google.android.youtube-1.apk

  3. List the permissions with
    aapt d permissions com.google.android.youtube-1.apk

Output:

    uses-permission: android.permission.BROADCAST_STICKY
    uses-permission: android.permission.CALL_PHONE
    uses-permission: android.permission.CALL_PRIVILEGED
    uses-permission: android.permission.WRITE_SETTINGS
    uses-permission: android.permission.WRITE_SECURE_SETTINGS
    uses-permission: android.permission.READ_CONTACTS
    uses-permission: android.permission.READ_CALL_LOG
    uses-permission: android.permission.WRITE_CONTACTS
    uses-permission: android.permission.WRITE_CALL_LOG
    uses-permission: android.permission.SYSTEM_ALERT_WINDOW
    uses-permission: android.permission.INTERNAL_SYSTEM_WINDOW
    uses-permission: android.permission.ADD_SYSTEM_SERVICE
    uses-permission: android.permission.VIBRATE
    uses-permission: android.permission.BLUETOOTH
    uses-permission: android.permission.BLUETOOTH_ADMIN
    uses-permission: android.permission.REORDER_TASKS
    uses-permission: android.permission.CHANGE_CONFIGURATION
    ...

> ...

Solution 3 - Android

The fast way: adb shell dumpsys package packagename | grep permission

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJuuso OhtonenView Question on Stackoverflow
Solution 1 - AndroidDenys Kniazhev-Support UkraineView Answer on Stackoverflow
Solution 2 - AndroidJuuso OhtonenView Answer on Stackoverflow
Solution 3 - AndroidjasonView Answer on Stackoverflow