Created
August 16, 2019 14:03
-
-
Save alexfu/9055e6d8aa0bb38f6a034effd068394e to your computer and use it in GitHub Desktop.
Starts up a random AVD
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
#!/usr/bin/env bash | |
emulator=$ANDROID_HOME/tools/emulator | |
adb=$ANDROID_HOME/platform-tools/adb | |
EMULATOR_COUNT=$($emulator -list-avds | wc -l | cut -c 8) | |
RANDOM_INDEX=$(shuf -i 1-$EMULATOR_COUNT -n 1) | |
EMULATOR_NAME=$($emulator -list-avds | head -n $RANDOM_INDEX | tail -n 1) | |
printf "Starting $EMULATOR_NAME..." | |
$emulator -avd $EMULATOR_NAME > /dev/null & # Send all output to /dev/null | |
$adb wait-for-device | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment