Last active
May 6, 2024 02:31
-
-
Save hidroh/67b2ee7bbdd9038450c00d8a4d69c3fa to your computer and use it in GitHub Desktop.
Handy bash script to prompt for an Android virtual device (AVD) selection and launch it. Assuming that Android SDK has been set up and is in user PATH.
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
emulator -list-avds | cat -n | |
printf "Select AVD: " | |
read index | |
avd=$(emulator -list-avds | sed "${index}q;d") | |
echo "Selected $avd" | |
emulator -netdelay none -netspeed full -avd $avd |
now the Open Avd is support to Windows, Linux and MacOS
I was facing an issue while running the script: "Could not launch '/Users/<redacted>/Library/Android/sdk/tools/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory
". I'm using macOS.
Then I found out that recent versions of the Android SDK, the emulator tool has been moved out of the tools
directory to its own emulator
directory at the same level as tools
. I had to modify the script to navigate to ${ANDROID_HOME}/emulator
instead of ${ANDROID_HOME}/tools
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank's !