LeeTee
LeeTee

Reputation: 6601

Running Android emulator via Cordova - AVD Manager missing from Android Studio

I have spent a 2 days trying to set up a Cordova App and to run it in an android emulator following the instructions on this page (https://cordova.apache.org/docs/en/latest/guide/cli/index.html) and relating pages. I have encountered countless issues, the latest one being that the android emulator wont run. When I run:

cordova emulate android

I get the following message which just stays there:

No emulator specified, defaulting to Nexus_5x_API_23_x86
Waiting for emulator.....

After searching for answers it seems I need to set up an Android Virtual Device (AVD). I have therefore started following these instructions (https://developer.android.com/studio/run/managing-avds.html) as told to do so by the Cordova instructions but I dont have the AVD Manager option available in my Android Studio.

Missing AVD Manager option under Tools

I have the path to the SDK set up as shown below.

enter image description here

Can anyone help with this? I am so fed up and confused by it all...

***********UPDATE**************

After the help below, I launched the AVD Manager from the Android SDK folder but came across the following error:

enter image description here

Upvotes: 3

Views: 6118

Answers (2)

Kurt Miller
Kurt Miller

Reputation: 567

Dont create the emulator in Android Studio. Instead create it with AVD Manager.exe

I suppose you have an android SDK folder (appart from the one created by Android Studio). In that SDK folder, you'll have AVD Manager.exe Run the AVD Manager from there, create the virtual machine (emulator) and launch it. Then use the appropriate cordova command to launch the app (in the running emulator ; created as I suggested)

In my case this is how the things work :

Steps :

  • I have downloaded android SDK package (for instance from here http://www.filehippo.com/download_android_sdk) and saved for instance at C:\Android_SDK
  • In that folder, you can download specific API level with SDK Manager.exe and create emulators with AVD Manager.exe
  • Next create an emulator via AVD Manager.exe located where you saved the SDK package (here C:\Android_SDK)
  • Launch (start) the emulator
  • WHEN THE EMULATOR IS DONE LOADING, run cordova build android and cordova emulate android (Don't forget to be in the working directory of your cordova project)
  • VOILA !!!

Upvotes: 5

Bartserk
Bartserk

Reputation: 675

Looks like you're missing the whole "Android" option in the Tools subsection, so I would start by checking if the Menus and Toolbars to check if everything is ok. This is how it looks on my computer (it's the macOS version, but should be similar)

enter image description here

If you're missing that section, try "Adding after" the options you're missing. Anyway, you should be able to run the Android Virtual Device manager by running the AVD.exe command on the binary folder

Upvotes: 2

Related Questions