Last active
August 31, 2018 18:49
-
-
Save mikehardy/d7d76a5f2e162093ba1913dab50c4235 to your computer and use it in GitHub Desktop.
Android emulator fleet management - startup
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 | |
for AVD in `emulator -list-avds`; do | |
echo -n Found $AVD... | |
SDCARD="/tmp/$AVD-sdcard.img" | |
NORMAL_ARGS="-no-boot-anim -sdcard $SDCARD" | |
EXTRA_ARGS="" | |
case "$AVD" in | |
*OLD*) | |
# Name your emulators with an "OLD" tag for API <=17 or sdcard doesn't auto-mount | |
echo "$AVD is old, using workaround..." | |
EXTRA_ARGS="$EXTRA_ARGS -engine classic" | |
;; | |
*NEW*) | |
# Name your emulators with a "NEW" tag for API >17 | |
echo "$AVD is new, normal emulator..." | |
;; | |
*ARM*) | |
# Don't use ARM emulators by default on x86 (so slow...) | |
echo "Skipping ARM emulator $AVD..." | |
continue | |
;; | |
*Chromebook*) | |
# Don't use Chromebook emulators by default | |
echo "Skipping Chromebook emulator $AVD..." | |
continue | |
;; | |
esac | |
$ANDROID_SDK/tools/mksdcard -l sdcard 100M $SDCARD | |
$ANDROID_SDK/emulator/emulator $NORMAL_ARGS $EXTRA_ARGS @$AVD & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment