2

Seems to be giving an error

This is what it keeps doing when I run

 $ cordova run android
    ANDROID_HOME=/Users/apple/Library/Android/sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
    No target specified, deploying to emulator
    No emulator specified, defaulting to Xamarin_Android_API_15
    Waiting for emulator...

so I tried this

cordova run android --list
Available android devices:
ERROR: Error: adb: Command failed with exit code ENOENT
An unexpected error has occured while running list-devices with code 2: Error: /Users/apple/survivedrive/platforms/android/cordova/lib/list-devices: Command failed with exit code 2
Available android virtual devices:
ERROR: Error: android: Command failed with exit code ENOENT
An unexpected error has occured while running list-emulator-images with code 2: Error: /Users/apple/survivedrive/platforms/android/cordova/lib/list-emulator-images: Command failed with exit code 2
APPLEs-MacBook-Pro-2:survivedrive UltimateCoder$ 
Kingsley Mitchell
  • 2,412
  • 2
  • 18
  • 25

3 Answers3

4

Since I ended up here trying to find solution to another issue, I will reply to the other part of your question, which helped me list virtual devices (according to your log, it is also not working).


To specify target id use:

cordova run android --target=Nexus_5X_API_22

For more details see: cordova run command


The second error which you get...

Available android virtual devices:
ERROR: Error: android: Command failed with exit code ENOENT

...when you run cordova run android --list is most probably due to unmodified/wrongly modified PATH. Try this (make sure to double check the paths on your machine):

export PATH=${PATH}:/Users/apple/Library/Android/sdk/platform-tools:/Users/apple/Library/Android/sdk/tools

For more details see: Setting environment variables


If you have Android Studio, then there is another way to see available virtual devices:

  1. Open Android Studio
  2. Open Android Virtual Device Manager
  3. Press black downward looking triangle
  4. Click on "View Details"
Andrei Sinitson
  • 739
  • 6
  • 10
2

I had the same problem, where it would say "Waiting for the emulator..." but the emulator never started up. Here is how to possibly solve it:

With Android Studio

Open AVD Manager (Tools > Android > AVD Manager) in Android Studio and delete and create a new AVD. Run your project again. It should start up fine, even though it may show the same warnings as before.

Using Terminal

Run AVD manager directly from the terminal (the command is the usually the following for Mac with the /username/ replaced by your user name):

$ /Users/username/Library/Android/sdk/tools/android avd

and check for any problems with your AVD. If you do see a problem (which generally is the case), delete your AVD and create a new one.

Gopinath
  • 184
  • 12
-1

May be you missing JRE,

JRE_HOME : C:\Program Files\Java\jre7

or else

You want it run in emulator or device?

If you want to run in the emulator then you have to create AVD. Check the below link to create AVD how to create a new AVD in eclipse?

If you want to run in the device install the USB driver for particular mobile device(for example if your device is Samsung then install Samsung USB driver). Connect it and run.

Community
  • 1
  • 1
NGB
  • 71
  • 1
  • 15