Use the command line in Android to take screenshots and export to your computer

Source: Internet
Author: User

Disclaimer: This blog for the original blog, without permission, not reproduced! original link to http://blog.csdn.net/bettarwang/article/details/27819525

Most of the screenshots most commonly used by most people may be using the phone's shortcut keys, but that would be inefficient if imported into a computer. In fact, there is a better screenshot, the simplest of course is to use the eclipse in the DDMS to intercept, click the "Screen Capture" button to wait for more than 10 seconds, and then you can directly use the Save button to save to the computer.

Obviously, due to the reasons for the picture display, there will be a certain delay in the DDMS, the efficiency is not high enough. In fact, the most efficient way is to use the command line to intercept the screen. The shell commands for the screenshot and the related parameters are:

screencap [-HP] [-D Display-id] [FILENAME]

-h:this message (This article)

-p:save the file as a PNG. (Save the file in PNG format)

-d:specify the display ID to Capture,default 0. (Specify the display number for this screenshot, default is 0)

If FILENAME ends with. png It'll be saved as a PNG. (If the file name ends with a. png, it will be saved as a PNG image)

If FILENAME is not given,the results would be printed to stdout. (If you do not specify a file name (in fact, the full path to the files), the results are printed in standard output. is actually the picture information will be printed to the screen, of course, is a garbled. Therefore, it is best to specify file names. )

In General,-h,-d These two parameters do not work for us, p used more places, but I do not recommend-p, for the following reasons:

For example, we use such a command: Screencap-p/MNT/SDCARD/PIC01, the truncated graphics filename is Pic01 instead of pic01.png, so the export command becomes the ADB pull/mnt/sdcard/pic01 d:/ , where d:/is the path we want to export to the computer, so we'll add a suffix to it.

Although can also use Screencap-p/mnt/sdcard/pic01.png command, but apparently there is no screencap/mnt/sdcard/pic01.png and

Screencap/mnt/sdcard/pic01.jpg such a command is convenient.

There are a few things to note: first, if you want to put in SDcard, it is not necessarily my path (/mnt/sdcard/), because this is related to the bottom of the soft implementation, it is best to Ddms to confirm; second, from the computer push APK to the mobile phone is to first remount, but from the phone pull files to the computer is not required to remount first; third, screenshot command is not screenshots, I tried, export to the computer found is very messy very strange graphics, interested children shoes can be verified.

All the above commands are personally verified by me, and the problem of the small partners to leave a message!


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.