Last active
June 18, 2017 23:53
-
-
Save linuxgemini/70fc8bf77a412ed9ea165c2cd2b08ae3 to your computer and use it in GitHub Desktop.
ADB Screenshotter for Mac, Usage (in Terminal): "./adbscreenshot-mac.sh <optional filename>" without quotes. Requires Android Studio, Check the filename<.png> you choose is not present in Desktop. The default is "screen<.png>".
This file contains hidden or 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 | |
if [ -e ~/Library/Android/sdk/platform-tools/adb ]; then | |
echo | |
echo ADB is installed. Go ahead. | |
echo | |
echo | |
else | |
echo | |
echo ADB, platform-tools or SDK is not installed. Install it and try again. | |
echo | |
exit | |
fi | |
if [ -z "$1" ]; then | |
echo Variable is empty, using \"screen\" as the filename... | |
echo | |
ADAMM="screen" | |
else | |
echo Using \"$1\" as the filename... | |
echo | |
ADAMM="$1" | |
fi | |
FILENAME="$ADAMM.png" | |
if [ -e ./$FILENAME ]; then | |
rm ./$FILENAME | |
echo Starting ADB Screenshotter... | |
echo | |
echo | |
else | |
echo Starting ADB Screenshotter... | |
echo | |
echo | |
fi | |
sleep 0.560 | |
~/Library/Android/sdk/platform-tools/adb shell screencap -p /sdcard/$FILENAME | |
echo TAKEN THE SCREENSHOT | |
sleep 0.840 | |
echo | |
~/Library/Android/sdk/platform-tools/adb pull /sdcard/$FILENAME ~/Desktop/ | |
echo PULLED THE SCREENSHOT TO DESKTOP | |
sleep 0.980 | |
echo | |
~/Library/Android/sdk/platform-tools/adb shell rm /sdcard/$FILENAME | |
echo REMOVED THE SCREENSHOT FROM PHONE/TABLET | |
sleep 1.080 | |
echo | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment