ADB Cheat Sheet: Screenshot, Screen Record, Logcat
This is a working reference for the ADB commands you reach for most often. It assumes platform-tools is installed and USB debugging is enabled on the phone. If you have more than one device attached, add -s <serial> after adb in every command.
Check the connection
adb devices
You should see a serial number with the state device. unauthorized means you must accept the prompt on the phone; offline usually clears after reconnecting the cable or running adb kill-server then adb start-server.
Command table
| Task | Command |
|---|---|
| List devices | adb devices -l |
| Screenshot on device | adb shell screencap -p /sdcard/screen.png |
| Screenshot to computer | adb exec-out screencap -p > screen.png |
| Record screen | adb shell screenrecord /sdcard/demo.mp4 |
| Record 30 seconds | adb shell screenrecord --time-limit 30 /sdcard/demo.mp4 |
| Install APK | adb install app.apk |
| Reinstall, keep data | adb install -r app.apk |
| Uninstall package | adb uninstall com.example.app |
| Copy file to phone | adb push local.txt /sdcard/Download/ |
| Copy file from phone | adb pull /sdcard/demo.mp4 . |
| Open a shell | adb shell |
Screenshots
The two-step method saves on the device first, then copies:
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
The one-line method avoids the temporary file:
adb exec-out screencap -p > screen.png
Use exec-out rather than shell here. Plain shell can alter line endings on some setups and corrupt the PNG.
Screen recording
adb shell screenrecord --time-limit 30 /sdcard/demo.mp4
adb pull /sdcard/demo.mp4
Press Ctrl+C to stop early. The default and maximum length is 180 seconds per file. Useful options include --size 1280x720 to reduce resolution and --bit-rate 6000000 to control quality. Audio is not recorded.
Installing apps
adb install app.apk
adb install -r app.apk
Add -d to allow a version downgrade where permitted, and -g to grant all runtime permissions at install. For split APKs use adb install-multiple base.apk split1.apk.
Logcat
Stream everything (noisy):
adb logcat
Useful filters:
adb logcat *:E # errors and above, all tags
adb logcat -s MyTag # only one tag
adb logcat MyTag:D *:S # debug for MyTag, silence the rest
adb logcat -d > log.txt # dump current buffer to a file and exit
adb logcat -c # clear the buffer
Priority letters from lowest to highest are V, D, I, W, E, F, with S meaning silent. To focus on one app, find its process ID with adb shell pidof com.example.app and run adb logcat --pid=<pid>.
File transfer tips
adb pushandadb pullaccept folders and copy recursively.- Paths on the phone are case-sensitive.
- Many modern Android versions restrict access to other apps’ private folders; use shared storage such as
/sdcard/.
Common problems
adb: command not found: platform-tools is not on your PATH. Run it from its folder or add it to PATH.more than one device/emulator: pass-s <serial>.- Permission denied on pull: the path is protected; copy to shared storage first.
- Blank or black recording: some apps block screen capture for security reasons.
A browser alternative
If you do not want to install anything, ADB Kit provides screenshots, WebM screen recording, APK install, logcat with filtering and file transfer inside Chrome or Edge using WebUSB. Setup is covered in our WebUSB ADB guide. The command line remains the right tool for scripting and automation, while the browser version suits quick, one-off jobs.
FAQ
How long can adb shell screenrecord record?
By default the limit is 180 seconds. You can set a shorter time with --time-limit, and the recording is saved on the device, so you pull it to your computer afterwards.
Why does adb devices show unauthorized?
The phone has not accepted the computer's debugging key. Unlock the phone, accept the prompt, or revoke USB debugging authorizations in Developer options and reconnect.
How do I save a screenshot straight to my computer?
Use adb exec-out screencap -p > screen.png, which streams the image to a local file without leaving a copy on the phone.
A local-first browser workspace for Android: mirror and control a device, capture screenshots and recordings, install APKs, stream logcat and move files over WebUSB.