Created
October 15, 2018 17:31
-
-
Save sobujbd/273d26382fb6aaf4221e9877054a3acb to your computer and use it in GitHub Desktop.
ADB Screen Capture
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
#!/bin/bash | |
# read -e -p "Enter File URL: " fileUrl | |
# if [ -z "${fileUrl}" ];then | |
# echo "Missing File URL!" | |
# exit | |
# fi | |
APP_NAME=$1 | |
FOLDER="/ApkScreenshot" | |
FILE_NAME="$APP_NAME-screenshot-" | |
FILE_PATH="$FOLDER/$APP_NAME/$FILE_NAME" | |
ext=".png" | |
if [ -z "$APP_NAME" ]; then | |
printf "\nUsage:\n\t adb_screencap <app name eg: MyApp>\n\n" | |
exit 0; | |
fi | |
mkdir -p "$FOLDER/$APP_NAME" | |
SAVE_AS=$FILE_PATH`ls $FILE_PATH* | wc -l`$ext | |
S=$(android-select-device "$@") | |
adb $S exec-out screencap -p > "$SAVE_AS" | |
echo "Screenshot saved here ${SAVE_AS}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment