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!