Appearance
adb screenshot and screenrecord: capture the phone's screen
In short: To take a screenshot with adb, run adb exec-out screencap -p > screen.png, which saves the phone's screen as a PNG on your computer. To record the screen, run adb shell screenrecord /sdcard/demo.mp4, stop it with Ctrl+C or after at most 180 seconds, and copy the video over with adb pull. Neither needs root.
Screenshots and recordings from adb are the quickest way to attach evidence to a bug report without picking up the phone.
Take a screenshot
bash
adb exec-out screencap -p > screen.pngpowershell
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.pngexec-out streams the PNG straight into the file on your computer. Windows PowerShell 5.1, the version built into Windows, changes binary output sent to a file with >, which breaks the PNG, so on Windows the picture is saved on the phone, copied over and then deleted from the phone.
Record the screen
bash
adb shell screenrecord --time-limit 30 /sdcard/demo.mp4
adb pull /sdcard/demo.mp4
adb shell rm /sdcard/demo.mp4| Option | What it does |
|---|---|
--time-limit 30 | Stops after 30 seconds; the default and the maximum are 180 |
--size 1280x720 | Records at a smaller size, which also helps when the encoder fails at full resolution |
--bit-rate 4M | Sets the video's bit rate; higher is sharper and larger |
--bugreport | Adds the time and other details to the video, useful in bug reports |
Press Ctrl+C to stop a recording early. The video has no sound, and parts of the screen that apps mark as secure are black.
On many phones at once
Comparing the same screen on many phones is how layout bugs show up. Save each phone's screenshot under its own name:
bash
for s in $(adb devices | awk 'NR>1 && $2=="device" {print $1}'); do
adb -s "$s" exec-out screencap -p > "screen-${s//[:\/]/_}.png"
donepowershell
adb devices | Select-Object -Skip 1 | ForEach-Object {
$serial, $state = $_ -split '\s+'
if ($state -eq 'device') {
adb -s $serial shell screencap -p /sdcard/screen.png
adb -s $serial pull /sdcard/screen.png "screen-$($serial -replace '[:\\/]', '_').png"
}
}BenchFleet shows every connected phone's screen live on one page. On Pro, its group actions take screenshots on many phones at once, and each workflow run keeps a screenshot of every step, so a failed run can be replayed step by step.
Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.
Common errors and fixes
| Problem | What it means | Fix |
|---|---|---|
| The screenshot is black | The app on screen blocks screenshots | Nothing to fix from the computer; test that screen by hand |
| The PNG will not open on Windows | PowerShell changed the binary output | Use the save-and-pull commands above |
Encoder failed or a recording that stops at once | The phone cannot encode video at full resolution | Add --size 1280x720 |
| The recording stops after three minutes | screenrecord's limit is 180 seconds | Start a new recording, or use scrcpy's recording |
adb: more than one device/emulator | Several phones are connected | Choose one with -s and its serial number |
Related
- adb push and pull: copy screenshots and recordings from the phone.
- adb logcat: the log to go with the screenshot.
- scrcpy for many phones: mirror and record phone screens on your computer.
- All ADB commands and the ADB command builder.
Questions
How do I take a screenshot with adb?
In bash or zsh, run adb exec-out screencap -p > screen.png. In Windows PowerShell, save it on the phone with adb shell screencap -p /sdcard/screen.png and copy it with adb pull /sdcard/screen.png.
How do I record the screen with adb?
Run adb shell screenrecord /sdcard/demo.mp4, stop it with Ctrl+C or let it reach its time limit, then run adb pull /sdcard/demo.mp4 to copy the video to your computer.
How long can adb screenrecord record?
180 seconds at most, which is also the default; --time-limit sets a shorter limit. For longer recordings, start a new one when the last ends, or record with scrcpy, which has no such limit.
Why is my adb screenshot black?
The app on screen marks its window as secure, as banking apps and some video apps do, so Android leaves it out of screenshots and recordings. Nothing on the computer side changes that.
Can adb record sound?
No, screenrecord captures video only. scrcpy can record the screen with sound on Android 11 and newer.
Start with the Free plan
Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.
- A full refund within 14 days of your first payment
- Starts in Local mode, with no telemetry or analytics
- Made by WOODCOMMERCE LTD, a company registered in the UK