nativescript-cli: 'tns devices' does not find emulators
Did you verify this is a real problem by searching
Couldn’t find a solution by searching.
Tell us about the problem
I have followed the installation guide in nativescript.org. I have installed android sdk. Then, installed android studio to create AVD as shown in the guide. AVD is working fine but tns devices
command cannot find emulators even though it finds connected android device.
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
- CLI: 3.1.3
- Cross-platform modules: Didn’t create a project yet
- Runtime(s): Didn’t create a project yet
- Plugin(s): Didn’t create a project yet
Please tell us how to recreate the issue in as much detail as possible.
Create an avd in android studio as shown in the nativescript guide for AVDs. Then run tns devices
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
No code.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (2 by maintainers)
I’m still getting the following error regardless of how I set ANDROID_HOME (with both the Homebrew installation and Android Studio installation).
I’ve tried both /usr/local/share/android-sdk (for Homebrew) and /Users/$user/Library/Android/sdk (for Android Studio)
Also I have an emulator installed but NativeScript still does not find it when I run
tns run android --bundle
The error I get is the following:
When I run
tns device android --available-devices
, a device shows up but it still says the following:Hi @erkanarslan,
tns device
ortns devices
gives you a list of all connected/started devices in the moment of executing the command. If you need to check available emulator images you can executetns devices android --available-devices
ortns devices ios --available-devices
.I had a similar issue (
tns run android
was not working). The NativeScript Advanced Installation instructions say to set ANDROID_HOME to /usr/local/share/android-sdk. But when I changed it to /Users/<username>/Library/Android/sdk it started working. It was a fresh install of NativeScript on a macbook pro High Sierra 10.13.4.Hi @erkanarslan,
What I mean by available devices is all images you have created on your machine and started or connected devices are the ones that are currently running. So when no emulators are running and no devices are paired
tns device
will output empty list, since there are no currently running devices. And once you have at least one running emulator/device it will return a list with it.Hope this clears out a bit how the command was intended to work.
@louis-morgan It’s been awhile since I’ve dealt with this but I remember writing my solution in the following issue: #4596