Created
November 18, 2016 16:36
-
-
Save guavabot/1474739af75a643732ba7fd0b29b066b to your computer and use it in GitHub Desktop.
Select an emulator and add local IP as http proxy
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 | |
emulator () { | |
EMULATORS=$(~/Library/Android/sdk/tools/emulator -list-avds) | |
LOCAL_PROXY_IP=`ipconfig getifaddr en0` | |
echo "Enter the number of the emulator you want to launch:" | |
PS3="Your choice: " | |
select EMULATOR in $EMULATORS; | |
do | |
if [ ! -z "$EMULATOR" ]; then | |
~/Library/Android/sdk/tools/emulator -avd $EMULATOR -http-proxy http://${LOCAL_PROXY_IP}:8888 & disown; | |
else | |
echo "Emulator $REPLY is not in the family of emulators!" | |
fi | |
break | |
done | |
} | |
emulator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment