View Help Commands
[email protected] ~$ adb shell screencap -vscreencap: invalid option -- vusage: screencap [-hp] [-d display-id] [FILENAME] -h: this message -p: save the file as a png. -d: specify the display id to capture, default 0.If FILENAME ends with .png it will be saved as a png.If FILENAME is not given, the results will be printed to stdout.
Attention:
If the file name ends with a. png, it is saved as a PNG file
If the file name is not given, the result is output to stdout
Save to SD card and export
$ adb shell screencap -p /sdcard/screen.png$ adb pull /sdcard/screen.png$ adb shell rm /sdcard/screen.png
This method is more troublesome and requires 3 steps: 1. Save to SDcard 2. Export the picture 3. Delete a picture from SDcard
Save directly to PC
$ adb shell screencap -p | sed ‘s/\r$//‘ > screen.png
The execute adb shell will \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
If you can use the alias package as a direct command:
In the future can be conveniently used And-screencap > directly will be saved to the computer
Android Command Screencap