Last active
April 8, 2021 10:44
-
-
Save royclarkson/aeb3313f307b28a62d23 to your computer and use it in GitHub Desktop.
Bash script to create an Android emulator for each API level
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 | |
function createavd { | |
if [ -n "$2" ]; then | |
echo "no" | android create avd -n Android-$1 -t android-$1 --abi $2 --force | |
else | |
echo "no" | android create avd -n Android-$1 -t android-$1 --force | |
fi | |
} | |
for ((API=8; API<=19; API++)); do | |
android delete avd -n Android-$API | |
output=$(createavd $API) | |
ret=$? | |
echo $output | |
if [ $ret -ne 0 ]; then | |
if [[ $output == *armeabi-v7a* ]]; then | |
createavd $API "armeabi-v7a" | |
elif [[ $output == *armeabi* ]]; then | |
createavd $API "armeabi" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, can you help with a test terminal command?