Created
November 5, 2016 08:10
-
-
Save Tanapruk/23d28e4fcf8c5b647ed28fca3ca5eb89 to your computer and use it in GitHub Desktop.
My Personal bash script as an Android Developer
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
#export path for android | |
export ANDROID_HOME=/Users/username/Documents/Android/sdk | |
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tool | |
#to capture screen from android phone | |
function cap() { | |
LOCATIONPHONE=sdcard/screen_$(date "+%Y%m%d%H%M%S").png | |
LOCATIONPC=~/Downloads/ | |
adb shell screencap -p $LOCATIONPHONE | |
adb pull -p $LOCATIONPHONE $LOCATIONPC | |
adb shell rm $LOCATIONPHONE | |
echo pulling data from $LOCATIONPHONE and save at $LOCATIONPC | |
} | |
#switch off/on WiFi | |
function wi() { | |
networksetup -setairportpower en0 off && networksetup -setairportpower en0 on | |
} | |
#Restart adb connection | |
function restartadb() { | |
adb start-server | |
echo "[$(date)] adb started" | |
echo "[$(date)] adb is broken, restarting" | |
adb kill-server | |
adb start-server || adb start-server | |
adb reverse tcp:8081 tcp:8081 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment