Skip to content

Instantly share code, notes, and snippets.

@bb441db
Created April 28, 2022 09:51
Show Gist options
  • Save bb441db/6fc8d15ea815a745e56f6816b68cae84 to your computer and use it in GitHub Desktop.
Save bb441db/6fc8d15ea815a745e56f6816b68cae84 to your computer and use it in GitHub Desktop.
Capture screenshot using ADB and save it on host
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