Skip to content

Instantly share code, notes, and snippets.

@tokgozmusa
Last active October 20, 2023 16:31
Show Gist options
  • Save tokgozmusa/d0c969402c771dbefe64c5fad1c7d4a2 to your computer and use it in GitHub Desktop.
Save tokgozmusa/d0c969402c771dbefe64c5fad1c7d4a2 to your computer and use it in GitHub Desktop.
Android Debug Bridge (ADB) Commands
$ adb devices
$ adb kill-server
$ adb reverse tcp:8081 tcp:8081
$ adb shell dumpsys activity activities | grep 'Hist #' | grep 'com.example.app'
$ adb shell dumpsys activity com.example.app
$ adb shell am start -n com.package.name/com.package.name.ActivityName
$ adb shell am start -W -a android.intent.action.VIEW -d "deeplink-uri" com.example.app
$ adb shell input keyevent KEYCODE_MENU
$ adb exec-out run-as debuggable.app.package.name cat databases/file > file
$ adb shell dumpsys activity activities | sed -En -e '/Stack #/p' -e '/Running activities/,/Run #0/p'
$ adb shell input keyevent 82
// Reset permissions
$ adb shell pm reset-permissions -p your.app.package 
$ adb shell pm grant [packageName] [ Permission]  // Grant a permission to an app. 
$ adb shell pm revoke [packageName] [ Permission]   // Revoke a permission from an app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment