From 098c076252d6a6969673179de33f2592548d6730 Mon Sep 17 00:00:00 2001 From: Zhuang Ma Date: Tue, 9 May 2017 21:26:37 +0800 Subject: [PATCH] Add single line command to save screenshot to computer, close #33 --- README.en.md | 12 ++++++++++-- README.md | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.en.md b/README.en.md index a9a81b5..1771a84 100644 --- a/README.en.md +++ b/README.en.md @@ -1748,7 +1748,15 @@ Means set hide status bar in applications whoes package name is `com.package1` o ### Screenshots -command: +Take screenshot and save to computer: + +```sh +adb exec-out screencap -p > sc.png +``` + +If your adb is old version, doesn't have `exec-out` command, then your can take screenshot like below: + +First, take screenshot and save to device: ```sh adb shell screencap -p /sdcard/sc.png @@ -1769,7 +1777,7 @@ 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: +Another method to save screenshot file to computer with a single line command: ```sh adb shell screencap -p | sed "s/\r$//" > sc.png diff --git a/README.md b/README.md index 447d10b..b0451b7 100644 --- a/README.md +++ b/README.md @@ -1755,7 +1755,15 @@ adb shell settings put global policy_control immersive.status=com.package1,com.p ### 屏幕截图 -命令: +截图保存到电脑: + +```sh +adb exec-out screencap -p > sc.png +``` + +如果 adb 版本较老,无法使用 `exec-out` 命令,这时候建议更新 adb 版本。无法更新的话可以使用以下麻烦点的办法: + +先截图保存到设备里: ```sh adb shell screencap -p /sdcard/sc.png @@ -1776,7 +1784,7 @@ adb pull /sdcard/sc.png 实测如果指定文件名以 `.png` 结尾时可以省略 -p 参数;否则需要使用 -p 参数。如果不指定文件名,截图文件的内容将直接输出到 stdout。 -直接一行命令截图并保存到电脑的方法: +另外一种一行命令截图并保存到电脑的方法: *Linux 和 Windows*