Capturing Android Screenshots and Screen Recordings with ADB
This guide shows two practical ways to grab images and videos from an Android device:
- Mirror the phone display to a computer and use desktop tools for screenshots and GIFs
- Use ADB commands (no UI mirroring required)
Both approaches assume USB debugging is enabled and ADB is installed.
Option 1: Mirror to Desktop and Capture There
- Display mirroring: Vysor (Chrome extension) or similar tools
- GIF capture: LICEcap (records a desktop window region directly into GIF)
Workflow example:
- Mirror the device screen to the desktop
- Use your OS’s screenshot shortcuts or LICEcap to record an area
Option 2: Pure ADB Commands
Screenshots with screencap
Prerequisite: the device shell includes /system/bin/screencap
A. Save on device, then pull to host
# Save PNG to device storage
adb shell screencap -p /sdcard/Pictures/snap.png
# Copy to host (Linux/macOS)
adb pull /sdcard/Pictures/snap.png ./
# Copy to host (Windows CMD)
adb pull /sdcard/Pictures/snap.png C:\captures\snap.png
# Optionally remove from device
adb shell rm /sdcard/Pictures/snap.png
B. Stream directly to the computer
Using exec-out avoids CR/LF issues and writes a clean PNG stream.
- Linux/macOS (bash/zsh):
adb exec-out screencap -p > screenshot.png
- Windows PowerShell:
adb exec-out screencap -p | Out-File -FilePath .\screenshot.png -Encoding Byte
- Windows CMD with sed (Git Bash or WSL installed):
adb shell screencap -p | sed "s/\r$//" > screenshot.png
The file is written to the current working directory.
C. Quick aliases/macros
- Linux/macOS (add to ~/.bashrc or ~/.zshrc):
snap() { adb exec-out screencap -p > "${1:-screen-$(date +%s).png}"; }
Usage: snap or snap myshot.png
- Windows CMD (temporary macro using doskey):
doskey snap=adb exec-out screencap -p ^> $1
Usage: snap shot.png (escape > with ^ in the macro).
For a persistent command on Windows, place a batch file (e.g., snap.cmd) somewhere on PATH:
@echo off
if "%~1"=="" (
set "_name=screen-%RANDOM%.png"
) else (
set "_name=%~1"
)
adb exec-out screencap -p > "%_name%"
Screen recording with screenrecord
Requirements:
- Available on Android 4.4 (API 19) and newer
- Output is MP4 video
- No audio capture
- Screen rotation during recording can crop or truncate frames on some devices
Basic recording
# Record until Ctrl+C or the default time limit (180s)
adb shell screenrecord /sdcard/Movies/capture.mp4
Set a maximum duration
# Record for 10 seconds
adb shell screenrecord --time-limit 10 /sdcard/Movies/capture.mp4
Control resolution
Some devices require a lower resolution if the native display is too large for the encoder.
# Record at 1280x720
adb shell screenrecord --size 1280x720 /sdcard/Movies/capture.mp4
Control bitrate
# 6 Mbps; accepts values like 6000000 or 6M
adb shell screenrecord --bit-rate 6M /sdcard/Movies/capture.mp4
Verbose output
adb shell screenrecord --time-limit 8 --verbose /sdcard/Movies/capture.mp4
Example messages include codec constraints, chosen size, and frame counters.
Experimental rotation
adb shell screenrecord --rotate /sdcard/Movies/capture.mp4
Behavior varies by device and OS version.
Help
adb shell screenrecord --help
Retrieve and clean up
# Pull to current directory
adb pull /sdcard/Movies/capture.mp4 ./
# Pull to a specific folder (Windows)
adb pull /sdcard/Movies/capture.mp4 D:\video\capture.mp4
# Optionally remove from device
adb shell rm /sdcard/Movies/capture.mp4
Converting recordings to GIF
- Use LICEcap to record a portion of you're desktop while the MP4 plays in a media player
- Alternatively, use command-line tools (e.g., ffmpeg + gifski) to convert MP4 to GIF