Capture the screen on mobile phone and save to computer with adb

Android Dec 28, 2021 Viewed 98 Comments 0

When your computer needs to take a screenshot of a mobile phone, you will take a screenshot on the mobile phone and then send the picture to the computer. Here is another simple method, connect the mobile phone to computer via usb, turn on the debug mode, and then use adb command to save the screenshot on the computer.

adb exec-out screencap

adb exec-out screencap -p > test.png

Note that this command is only successful when it runs without errors

adb shell screencap

Use adb shell screencap to generate the screenshot to the specified path on the mobile phone, and then use adb pull to copy the screenshot to the current directory on the computer, finally run adb shell rm to delete the screenshot file of the mobile phone.

adb shell screencap /sdcard/Download/test.png
adb pull /sdcard/Download/test.png
adb shell rm /sdcard/Download/test.png
Updated Dec 28, 2021