标签:android c style class blog code
bixiaopeng@bixiaopeng ~$ adb shell screencap -v
screencap: invalid option -- v
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.
注意:
如果文件名以.png结尾时,它将保存为png文件
如果文件名没有给出,则结果被会被输出到stdout
$ adb shell screencap -p /sdcard/screen.png
$ adb pull /sdcard/screen.png
$ adb shell rm /sdcard/screen.png
这种方法比较麻烦,需要3步:1. 截图保存到sdcard 2.将图片导出 3.删除sdcard中的图片
$ adb shell screencap -p | sed ‘s/\r$//‘ > screen.png
执行adb shell 将\n转换\r\n, 因此需要用sed删除多余的\r
$ alias and-screencap="adb shell screencap -p | sed ‘s/\r$//‘"
$ and-screencap > screen.png
以后就可以方便的用and-screencap > 直接将截图保存到电脑上了
作者: 毕小朋 | 老 毕 邮箱: wirelessqa.me@gmail.com
微博: @WirelessQA 博客: http://blog.csdn.net/wirelessqa
Android截图命令screencap,布布扣,bubuko.com
标签:android c style class blog code
原文地址:http://blog.csdn.net/wirelessqa/article/details/29187339