Skip to content

Instantly share code, notes, and snippets.

@stantronic
Last active November 2, 2023 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stantronic/be783da2351051ad39d1696fa5db6d2c to your computer and use it in GitHub Desktop.
Save stantronic/be783da2351051ad39d1696fa5db6d2c to your computer and use it in GitHub Desktop.

My ADB Cheatsheet

A list of ADB commands I find helpful in general Android Development

ADB stands for Android Device Bridge - it is a program that runs on the host machine for communicating with both real and virtual android devices.

  • adb start-server - start a connection from development machine to android devices
  • adb kill-server - kill the connection from development machine to android devices
  • adb shell <command> - run a bash command on the device
  • adb shell pm <args> - run a command on the package manager
  • adb shell pidof <package name> get the process id of the given package. Will return empty if no app is running with that package
  • adb shell pm list packages list of packages for installed apps
  • adb shell am clear-debug-app to clear the debugger (useful when you get stuck on "Waiting for debugger...")
  • adb shell pm clear <package name> stop app with package name
  • adb logcat run logcat in terminal
  • adb devices -l get list of currently connected devices
  • adb shell getprop get summary of device properties
  • adb shell getprop ro.build.version.release get the android version of the current device
  • adb shell getprop ro.build.version.sdk get the api version of the current device
  • adb shell pm grant your.app.packagename android.permission.<permission-name> grant a permission to an app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment