Skip to content

Instantly share code, notes, and snippets.

@manojrege
Last active May 10, 2024 02:18
Show Gist options
  • Save manojrege/4d97c9c697e74e37a1011ac42d63f198 to your computer and use it in GitHub Desktop.
Save manojrege/4d97c9c697e74e37a1011ac42d63f198 to your computer and use it in GitHub Desktop.
ADB cheatsheet

Devices

List all connected devices - adb devices

Select a particular device - adb -s <device name> <command>

Shell

Android shell - adb shell

NTP

Set NTP server for android - adb shell settings put global ntp_server <server_name>

List NTP server - adb shell settings get global ntp_server

Logs

Android Logs - adb logcat Clear Android log buffer - adb logcat -c

Install Packages

Install app - adb install <apk> Reinstall app - adb install -r <apk>

List all Packages adb shell pm list packages -f

Get uid of an app

adb shell "cmd package list packages -U" | grep "<APP_PACKAGE_NAME>"

Port numbers used by an app

adb shell ps | grep "<APP_PACKAGE_NAME>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment