2.NativeScript SetUp For Windows

晁砚
2023-12-01

Setup

1.     Install Node.js.

1.     Go to http://nodejs.org and click Install.

2.     If prompted, confirm the download.

3.     After the download completes, run theinstaller and complete the installation.

2.     Install Chocolatey to simplify the installation and configurationof the Android tools and SDKs.

1.     Run the command prompt as an Administrator.

2.     Copy and paste the following script in thecommand prompt.

§  Shell

@powershell-NoProfile-ExecutionPolicy unrestricted -Command"iex ((new-objectnet.webclient).DownloadString('https://chocolatey.org/install.ps1'))"&& SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

3.     Restart the command prompt.

3.     Install JDK 7 or a later stableofficial release.

1.     In the command prompt, run the followingcommand.

§  Shell

choco install java

2.     If not present, create the followingenvironment variable.

JAVA_HOME=Path to the jdk* install folder

For example: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11

4.     Install ApacheAnt 1.8 or a later stableofficial release.

1.     In the command prompt, run the followingcommand.

§  Shell

choco install ant

2.     If not present, add the following file path tothe PATH system environment variable.

Path to the bin directory in the ApacheAnt installation folder

For example: PATH=...;...;C:\tools\apache-ant-1.9.4\bin

5.     Install the AndroidSDK.

1.     In the command prompt, run the followingcommand.

§  Shell

choco install android-sdk

2.     If not present, add the following file pathsto the PATH system environmentvariable.

3. Path to tools directory in the Android SDK installation folder

Path to platform-tools directory in the Android SDK installation folder

For example:PATH=...;...;C:\Users\MyUser\AppData\Local\Android\android-sdk\tools;C:\Users\MyUser\AppData\Local\Android\android-sdk\platform-tools

4.     Restart the command prompt and run thefollowing command.

androidupdate sdk

5.     Select all packages for the Android 19 SDK andany other SDKs that you want to install and click Install.

6.     (Optional) Install Genymotion.
Genymotion is a third-party native emulator.

1.     Go to GetGenymotion, select Windows andclick GetGenymotion.
You might want to download the larger archive which contains VirtualBox.

2.     If prompted, confirm the download.

3.     After the download completes, run theinstaller and complete the installation.

7.     Install the NativeScript CLI.

1.     Run the following command.

§  Shell

npm i -g nativescript

2.     Restart the command prompt.

 

 类似资料: