screencap 的帮助信息:
adb shell screencap -h usage: 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.
截屏命令:
1、获取 root 权限, 所以如果没有root 权限也无法进行截屏。
2、可以指定/data目录,或者 /sdcard目录 作为存储位置。其他目录可能会没有写的权限;
3、将截好的文件pull到 PC 机目录。
完整指令如下:
adb root
adb shell screencap -p /data/test.png
adb pull /data/test.png . 注:指令有一个小点,即当前目录