Skip to content

Instantly share code, notes, and snippets.

@royclarkson
Last active April 8, 2021 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save royclarkson/aeb3313f307b28a62d23 to your computer and use it in GitHub Desktop.
Save royclarkson/aeb3313f307b28a62d23 to your computer and use it in GitHub Desktop.
Bash script to create an Android emulator for each API level
#!/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
@SunnyBe
Copy link

SunnyBe commented Apr 8, 2021

Hi there, can you help with a test terminal command?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment