This tutorial help you to install NativeScript (https://www.nativescript.org/) on your machine. After completing this tutorial you will be able to run a basic project of Native Script.
- Hello World
NativeScript CLI build on Nodejs so you must have to install Nodejs before using it. If you are using Mac and you have alredy installed brew (https://brew.sh) then open terminal and type following command to install Nodejs
brew install nodejs
For other platform installation please check https://nodejs.org/
I am assuming that you are using Mac
npm install -g nativescript
You may need to use sudo to install native script globally on Mac. For on the other platform installation of NativeScript please check there documentation (http://docs.nativescript.org/start/quick-setup)
To create a Hello World project open the terminal and type following command
tns create HelloWorld
If you want to use TypeScript or Angular template please use following tags to create your project.
tns create HelloWorld --tsc // for TypeScript tns create HelloWorld --ng // for Angular
Go to HelloWorld project and using terminal and type following and hit enter to run the project on iOS emulator.
tns run android --emulator // it will run into Android emulator tns run ios --emulator it will run into iOS emulator
It should launch an Android or iPhone emulator base on above command and run the project.