Skip to content

Instantly share code, notes, and snippets.

@valentincognito
Last active August 16, 2018 10:04
Show Gist options
  • Save valentincognito/7b13d3792d1d72c0dae62de815308069 to your computer and use it in GitHub Desktop.
Save valentincognito/7b13d3792d1d72c0dae62de815308069 to your computer and use it in GitHub Desktop.
List of useful commands and tips for the android debug bridge

App permissions

//list all packages
adb shell pm list packages

//list all android permissions
adb shell pm list permissions -d -g

//grant / revoke permission for a specific package
adb shell pm revoke com.google.android.GoogleCamera  android.permission.CAMERA
adb shell pm grant com.google.android.GoogleCamera android.permission.CAMERA

Window pin the current activity

task_id=$(dumpsys activity | grep -A2 "(dumpsys activity recents)"| grep '#'| cut -d ' ' -f 7| cut -c 2-); am task lock $task_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment