adb cheat sheet
The sixty commands you actually use, grouped by job: finding processes, reading services, inspecting packages, capturing logs and forcing device states.
A reference card, not a tutorial. Every command here is one an Android engineer uses routinely. The labs walk through them with context.
TL;DR#
adb shellgets you a shell inside the device; most tools live there.dumpsys <service>is the single most useful command on Android.pm,amandcmdare the entry points to package, activity and service control.
Mental model#
Treat the device as a remote Unix box with three extra command families: one for packages (pm), one
for activities and processes (am), and one for arbitrary system-service commands (cmd). Everything
else is ordinary Unix.
Where the analogy breaks#
The shell user is not root. The shell UID has its own privileges and its own SELinux domain, so
some paths and services are invisible to it even though adb feels privileged.
The big picture#
Text description of this diagram
The Android stack, with each adb command family mapped to the layer it inspects. The device shell reaches the kernel through proc and sys, the native daemons through service list and dumpsys, the framework services through dumpsys and cmd, and apps through pm and am.
Deep dive#
Connection#
adb devices
adb pair 192.168.1.20:37000 # wireless pairing, Android 11+
adb connect 192.168.1.20:5555
adb disconnect
adb kill-server && adb start-serverProcesses and UIDs#
adb shell ps -A # all processes
adb shell ps -A -o USER,PID,PPID,NAME # with parent and owner
adb shell ps -T -p 1234 # threads in one process
adb shell cat /proc/1234/status # process details
adb shell cat /proc/1234/oom_score_adj
adb shell top # live CPU
adb shell pidof com.android.chromeServices and the framework#
adb shell service list # every registered binder service
adb shell dumpsys -l # every service with a dump() implementation
adb shell dumpsys activity activities # task and activity stack
adb shell dumpsys activity processes # process list with adj values
adb shell dumpsys window windows # window list and focus
adb shell dumpsys window displays # display and inset state
adb shell dumpsys package com.example
adb shell dumpsys meminfo com.example
adb shell dumpsys gfxinfo com.example framestats
adb shell dumpsys batterystats --charged
adb shell dumpsys jobscheduler
adb shell dumpsys alarm
adb shell dumpsys notification --noredact
adb shell cmd activity ...
adb shell cmd package ...Packages#
adb shell pm list packages
adb shell pm list packages -3 # third-party only
adb shell pm list packages -s # system only
adb shell pm path com.example
adb shell pm grant com.example android.permission.CAMERA
adb shell pm revoke com.example android.permission.CAMERA
adb shell pm clear com.example
adb shell pm dump com.example
adb install -r app.apk
adb install-multiple base.apk split_config.arm64_v8a.apk
adb uninstall com.exampleActivities and processes#
adb shell am start -n com.example/.MainActivity
adb shell am start -W -a android.intent.action.VIEW -d https://example.com
adb shell am force-stop com.example # kill and stop everything
adb shell am kill com.example # kill only if background-safe
adb shell am broadcast -a com.example.PING
adb shell am set-standby-bucket com.example rare
adb shell am get-standby-bucket com.example
adb shell am send-trim-memory com.example RUNNING_LOWProperties and settings#
adb shell getprop | grep ro.build
adb shell getprop dalvik.vm.heapsize
adb shell settings list global
adb shell settings get global airplane_mode_on
adb shell settings put global window_animation_scale 0
adb shell cmd deviceidle force-idle
adb shell cmd deviceidle unforceLogs#
adb logcat
adb logcat -b main -b system -b crash
adb logcat -s AndroidRuntime:E
adb logcat --pid=$(adb shell pidof com.example)
adb logcat -c # clear
adb bugreport bugreport.zip
adb shell ls /data/anr/Files and screenshots#
adb pull /sdcard/Download/file.txt
adb push local.txt /sdcard/Download/
adb exec-out screencap -p > screen.png
adb exec-out screenrecord --time-limit 10 /sdcard/rec.mp4
adb shell input tap 540 1200
adb shell input swipe 500 1500 500 300 300
adb shell input text "hello"
adb shell uiautomator dump && adb shell cat /sdcard/window_dump.xmlTracing#
adb shell perfetto -o /data/misc/perfetto-traces/trace -t 10s sched freq idle am wm gfx view binder_driver
adb pull /data/misc/perfetto-traces/trace
adb shell atrace --list_categoriesHow it evolved#
Curiosity corner#
dumpsyscalls a method on the service. It is not a special debugging channel; it invokesdump()over Binder, which is why output quality varies so much between services.am killandam force-stopare different. One respects the system's rules; the other does not.
Try it#
The labs are the guided version of this sheet. Start at Lab 1.
Check yourself#
Check yourself
What does an API level identify?
Sources#
Sources
Every version number, API level, class name and date on this page is traced to one of these. Pages are re-verified against them; last_verified above says when.
- docsAndroid Debug Bridge (adb)developer.android.comaccessed 2026-10-27↩
- docsdumpsysdeveloper.android.comaccessed 2026-10-27↩