I've got a few AVDs defined for testing on various API levels, 10-19. When I run cordova emulate android
, it says:
WARNING : no emulator specified, defaulting to {ITEM ON THE TOP}
It selects the target AVD at the top of the list, whatever that might be. As a result, I've been deleting all AVDs and re-creating a new one when I need to test a new device. I can't find any flags for cordova emulate
for selecting an AVD, is there such a flag? Or is there a way to specify a default AVD?
In Android Studio go to “Tools (Menu Bar) >Android > AVD Manager. Click on the “Create Virtual Device” button. Select “Phone” or “Tablet” as Category and select the device which you want to use to make a Virtual Device.
How to reproduce : Run this command : cordova build android. Run this command to launch android emulator : cordova emulate android --verbose.
An Android emulator is an Android Virtual Device (AVD) that represents a specific Android device. You can use an Android emulator as a target platform to run and test your Android applications on your PC. Using Android emulators is optional.
cordova emulate --target={AVD_NAME} android
.
For some reason I thought that --target
meant the Android version target (eg, 4.0.3) and would thus create an ad hoc AVD. Don't know why I thought that. But anyway, --target is the name/ID of your AVD.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With