简体   繁体   中英

Android studio AVD doesn't show up in terminal when running ionic cordova emulate android

I have an AVD that I created in Android Studio, here are the details of it:

https://i.imgur.com/CapOPE3.png

When I run ionic cordova emulate android in my ionic project, I get this error:

ANDROID_HOME=/Users/joshterrill/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
Error: No emulator images (avds) found.
1. Download desired System Image by running: /Users/joshterrill/Library/Android/sdk/tools/android sdk
2. Create an AVD by running: /Users/joshterrill/Library/Android/sdk/tools/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver

[ERROR] An error occurred while running cordova emulate android (exit code 1).

When I run this command: ~/Library/Android/sdk/tools/android list avd I get this:

Joshs-MacBook-Pro:~ joshterrill$ ~/Library/Android/sdk/tools/android list avd
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running /Users/joshterrill/Library/Android/sdk/tools/bin/avdmanager list avd

Available Android Virtual Devices:
Joshs-MacBook-Pro:~ joshterrill$ 

So it doesn't show that I have any there.

Also, here's a screenshot of Android Studio which shows that my SDK is currently installed in the same place that I'm looking for the AVD:

https://i.imgur.com/ZWJ4rns.png

Any ideas on why the AVD isn't showing up? I understand that the first error shown from the emulate command gives me the ability to create an AVD from the command line, but I'm going to need to create various AVD's from Android Studio and need to figure out why the terminal doesn't see them.

The answer to this problem was having the correct information in my $PATH . Here's what ended up working for me:

export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:/Users/mylaptop/Library/Android/sdk/platform-tools/adb:/Users/mylaptop/Library/Android/sdk/platform-tools:/Users/mylaptop/Library/Android/sdk/tools

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM