Setup an emulator


#1

I am stuck on one of installations steps…
I finished all that was written on https://docs.nativescript.org/angular/start/quick-setup
tns doctor says ok

But I cannot run a HelloWorld application
image
As I understand, my problem can be related to this point:

You must have at least one AVD (Android Virtual Device) configured on your development machine for this command to run your app up on an Android emulator. If you don’t have one installed currently go ahead and set one up now.

When i try tns device I see

$ tns device
Connected devices & emulators
Searching for devices…
iTunes is not installed. Install it on your system and run this command again.
Cannot find connected devices. Reconnect any connected devices, verify that your system recogmand again.

Tried to look here https://developer.android.com/studio/run/managing-avds.html but did not understand what should I do now.

Should I install something else except all the things that were installed by
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))" ?

(I am on a Windows 10 machine.)

To be honest, I’m quite a beginner with mobile development.

I will be glad to any help.


#2

You have to launch one of your emulators and then run the tns commands.


#3

I have the exact same scenario as the OP. Please can you be more specific though…HOW exactly do I “launch one of your emulators”?


#4

Yeah I think we’re missing some step…the documentation mentions

“You must have at least one AVD (Android Virtual Device) configured on your development machine for this command to run your app up on an Android emulator. If you don’t have one installed currently go ahead and set one up now.”

That “set one up now” link refers one to this page, and the first step there is:

"To open the AVD Manager, do one of the following:

Select Tools > Android > AVD Manager."

But WHERE does one find this “Tools” option it is referring to? Is it possibly in Android Studio? But if so, that begs the question…must I install Android Studio in order to build and run NativeScript apps? I’m sure that’s NOT the case…it seems like overkill.


#5

Ok, so I’ve gone the route of installing Android Studio, but I still can’t find this “Tools > Android > AVD Manager” option that the documentation is referring to!

In the IDE, there is a Tools menu, but it has no Android sub-menu.

In the Settings, there is a Tools section, but it also has no Android sub-section.

Please help.


#6

Google almost made it mandatory to have Android Studio in order to easily install / update Android SDK tools. There was built-in GUI for SDK and AVD manager within Android SDK but in recent releases they removed it and insisting developers to have Android Studio to continue using similar features. So it became like Xcode for iOS :joy:

You will have to install Android SDK / Platform Tools from Studio, but it doesn’t come within Studio package. I think once you install them you will get the Android menu.


#7

Thanks for that info.
Based on what I see in the Android SDK section under System Settings, what am I still missing for the “Android” option to appear under the Tools menu?


#8

Wow I got it to add the “Android” sub-menu under the Tools menu.

In Android Studio, I created a new project, and left all default inputs. Then, when opening the project, I noticed some errors in the Gradle Console…an error about the SDK being missing, and the Build Tools being missing. Each of these errors had links to execute the missing installations. After these had completed, I finally had the Android sub-menu under the Tools menu.

And under the Android menu, I see there is the AVD Manager option that the documentation referred to…so now let me carry on working through that documentation to see if I can get a AVD up and running for tns run android command from the opening post.


#9

Thank you very much for your contribution, I can not believe that this information is not in the documentation.
2 days ago I am dealing with the AVD Manager without being able to run the simulator and I ended up doing it thanks to your comment.
Thank you very much!
Greetings.