When developing React Native apps, Android Emulator is essential to testing the Android part, but it is tedious to start Android Studio each time just to run the Emulator.
Fortunately, Android Emulator has a command line tool which can be configured to start the emulator with specific AVD right from your favorite IDE.
In my case this is WebStorm, but it took some tinkering to get the configuration right, because WebStorm Bash runner expects a script name to run, but the emulator
tool expects argument -avd AVD_Name
as option and WebStorm put that in quotes so it did not work right away.
The working configuration is to set it up as seen in the screenshot:
- the AVD name as Script
- full path to
emulator
as the Interpreter path -avd
as Interpreter Arguments
Now it runs the command
emulator -avd "AVD_name"
which successfully starts the correct image.