Created
December 18, 2018 09:09
-
-
Save cattaka/9740a4157a98331fe8f5be338cab497f to your computer and use it in GitHub Desktop.
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 | |
NUM=$1 | |
if [[ ! "$NUM" =~ ^[0-9]+$ ]] || [ "$NUM" -le 0 ]; then | |
echo "Usage: launch-emurators.sh <num>" | |
exit | |
fi | |
EMULATOR_PIDS="" | |
shift 1 | |
for i in $(seq 1 $NUM);do | |
$ANDROID_HOME/emulator/emulator -avd Nexus_5X_API_27 -read-only $@ & | |
EMULATOR_PIDS="$! $EMULATOR_PIDS" | |
done | |
echo $EMULATOR_PIDS | |
trap 'echo "killing $EMULATOR_PIDS";kill $EMULATOR_PIDS;' INT | |
wait -n "$EMULATOR_PIDS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment