Add single line command to screenshot and save to PC

mz-dev
Zhuang Ma 8 years ago
parent fc77c06362
commit ca134e2e23
  1. 8
      README.en.md
  2. 8
      README.md

@ -1598,6 +1598,14 @@ You can use the `adb shell screencap -h` See` help screencap` command, here are
Found If you specify a file name can be omitted when the -p parameter to `.png` ending; otherwise you need to use the -p parameter. If you do not specify a file name, file contents screenshot will be directly output to stdout.
Save screenshot file to computer with a single line command:
```sh
adb shell screencap -p | sed "s/\r$//" > sc.png
```
This depends on `sed` command, it's avaliable in Linux and Mac OS X by default. In Windows, you may find it in bin directory in Git installation place. Otherwise, you may need to download [sed for Windows](http://gnuwin32.sourceforge.net/packages/sed.htm) and add the directory where sed.exe is to PATH environment variable.
### Recording Screen
Record screen are saved in mp4 format to / sdcard:

@ -1598,6 +1598,14 @@ adb pull /sdcard/sc.png
实测如果指定文件名以 `.png` 结尾时可以省略 -p 参数;否则需要使用 -p 参数。如果不指定文件名,截图文件的内容将直接输出到 stdout。
直接一行命令截图并保存到电脑的方法:
```sh
adb shell screencap -p | sed "s/\r$//" > sc.png
```
这个方法需要用到 sed 命令,在 Linux 和 Mac 下直接就有,在 Windows 下 Git 安装文件夹的 bin 目录下也有。如果确实找不到该命令,可以下载 [sed for Windows](http://gnuwin32.sourceforge.net/packages/sed.htm) 并将 sed.exe 所在目录添加到 PATH 环境变量里。
### 录制屏幕
录制屏幕以 mp4 格式保存到 /sdcard:

Loading…
Cancel
Save