Is there a way when using Cordova CLI to select a particular emulated device from the Android Device Manager (AVD)?
I am working on a tablet app and a smartphone app at the same time and need to switch to different types of emulators because of the different form factors and screen resolutions?
I know it's not a particular coding question but perhaps there is some Cordova code I can run in terminal to make the emulation more specific rather than:
cordova emulate android
Which seems to pick the first emulator off the stack.
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.
Use the target
parameter like this:
cordova emulate --target=emulator-5554 android
To get the device name of your emulator ("emulator-5554" in this example), run /platforms/android/cordova/lib/list-started-emulators.bat
If you run the following command you will get a list of all available devices:
cordova run android --list
Next you can emulate your app by running:
cordova run android --target="<Device_Name>"
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