Android uses shell script to screen and automatically upload to computer _android

Source: Internet
Author: User

The Android device has been used for a long time, and screenshots are a hassle. The more troublesome is through QQ to the computer, for half a day. In fact, with the ADB command can screen, and then write a pull statement can be pulled to the computer. The file name is capture.sh and reads as follows:

#! /bin/bash 
adb shell screencap-p/sdcard/test.png 
#adb pull/sdcard/test.png ~/desktop/test.png 
dir=~/ desktop/ 
curr= ' date ' +%y-%m-%d%h:%m:%s ' Name=${dir} ' screenshot ' ${curr} ' 
. png ' 
echo ' ${name} ' 

The description is as follows:

1, the computer environment for the mac,windows need to change the path, there is no test;

2, try to manually knock the code into the new script file with Vim, or you will encounter some weird problems.

3, run the script./capture.sh the screen automatically, and upload the file to the computer desktop.

The above to introduce Android using Shell script screen and automatically uploaded to the computer related knowledge, hope to help everyone!

Related Article

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.