8/16/2018 - 10:00 AM


List of useful commands and tips for the android debug bridge

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

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  android.permission.CAMERA
adb shell pm grant android.permission.CAMERA