Created
April 28, 2022 09:51
-
-
Save bb441db/6fc8d15ea815a745e56f6816b68cae84 to your computer and use it in GitHub Desktop.
Capture screenshot using ADB and save it on host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ! [ -x "$(command -v adb)" ]; then | |
echo "adb is not installed" >&2 | |
exit 1 | |
fi | |
if [ $1 ]; then | |
adb exec-out screencap -p > $1 | |
if [ ! -f $1 ]; then | |
echo "Did not create file $1" | |
exit 1 | |
fi | |
else | |
adb exec-out screencap -p >&1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment