Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova emulate - selecting an Android Virtual Device

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?

like image 313
lefnire Avatar asked May 02 '14 20:05

lefnire


People also ask

How do I select a virtual device in Android Studio?

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 do you emulate in cordova?

How to reproduce : Run this command : cordova build android. Run this command to launch android emulator : cordova emulate android --verbose.

What is Android Virtual Device emulator?

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.


1 Answers

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.

like image 85
lefnire Avatar answered Sep 30 '22 19:09

lefnire