EN
Explore apps

ADB Cheat Sheet: Screenshot, Screen Record, Logcat

· adb · logcat · android · cheat sheet

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

TaskCommand
List devicesadb devices -l
Screenshot on deviceadb shell screencap -p /sdcard/screen.png
Screenshot to computeradb exec-out screencap -p > screen.png
Record screenadb shell screenrecord /sdcard/demo.mp4
Record 30 secondsadb shell screenrecord --time-limit 30 /sdcard/demo.mp4
Install APKadb install app.apk
Reinstall, keep dataadb install -r app.apk
Uninstall packageadb uninstall com.example.app
Copy file to phoneadb push local.txt /sdcard/Download/
Copy file from phoneadb pull /sdcard/demo.mp4 .
Open a shelladb 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

Common problems

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.

ADB Kit

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.

View app →

More guides