8.6 Released with 🥽 visionOS support and more!
Check it out

Setting up Windows for Android

You will need Node, a JDK (java development kit), Android Studio and the NativeScript CLI (command line interface).

Android Studio is not strictly necessary — however it provides an easy-to-use interface for installing and managing the Android SDKs.

We recommend using Chocolatey to install the required dependencies — a popular package manager for Windows.

Setting up the Android development environment can be daunting if you are new to Android development, however following the next steps carefully will get you up and running in no time.

Installing Node

To install Node we recommend using a node version manager, such as nvm-windows, nvs or any other node version manager you prefer. In these docs we will be using nvm-windows, but feel free to use a different node version manager.

  1. Follow the install instructions in the nvm-windows repository. We recommend using the installer, however if you have a more advanced understanding of your needs you may also go for the manual installation instead.
  2. Run and follow the nvm-setup.exe instructions.
  3. Once the installation is complete, open a new Command Prompt and verify you can run nvm ls.
  4. Install the latest Node release with:
    cli
    nvm install node
  5. Verify the installation was successful and run
    cli
    node -v
    npm -v

Troubleshooting

If any of the above failed, we recommend checking out the Microsoft Docs for Setting up Node, or asking in our Community Discord for assistance.

Installing a JDK

To install a JDK (using the prebuilt OpenJDK binaries from Adoptium) open an Administrator Command Prompt (right click and select "Run as Administrator") and run the following command:

cli
choco install -y temurin11

Once installed, you might need to add it to your Path. First, check if you need to add it to your Path by opening a new Command Prompt and running the following:

cli
javac --version

If you see a version number printed, you are ready to move on to Installing Android Studio, otherwise you will need to add the JDK binaries to your system environment Path:

  1. Search for "Edit the system environment variables" in Windows Search and select
  2. Click on "Environment variables..." in the bottom corner
  3. Under the "User variables for..." select the Path variable and click Edit...
  4. Click New and add the JDK binaries folder path to the list. The default location is
    %LOCALAPPDATA%\???

Installing Android Studio

Download and install Android Studio. In the installation wizard make sure you have the following components selected (the list should appear if you select custom options):

The setup may take a while, but once it has finished a welcome screen should appear.

Android Studio installs the latest Android SDK by default, which in most cases should be all that's needed to build a NativeScript app.

Configuring ANDROID_HOME and PATH

Configure the ANDROID_HOME environment variable for NativeScript to be able to find the Android SDK.

  1. Search for "Edit the system environment variables" in Windows Search and select
  2. Click on "Environment variables..." in the bottom corner
  3. Under the "User variables for..." click on New... to create the ANDROID_HOME user variable that points to the path of the Android SDK:

New User Variable (ANDROID_HOME)

The SDK is by default located at:

%LOCALAPPDATA%\Android\Sdk

To find the actual location in the Android Studio Settings, navigate to Appearance & Behavior › System Settings › Android SDK and copy the Android SDK Location.

Next, add Android platform-tools to path:

  1. Search for "Edit the system environment variables" in Windows Search and select
  2. Click on "Environment variables..." in the bottom corner
  3. Under the "User variables for..." select the Path variable and click Edit...
  4. Click New and add the platform-tools path to the list. The default location is inside the Android SDK's platform-tools folder:
    %LOCALAPPDATA%\Android\Sdk\platform-tools

Installing the NativeScript CLI

Install the NativeScript CLI globally:

cli
npm install -g nativescript
You may see Deprecation and security warnings from npm, these are safe to ignore. Read more...

The NativeScript CLI relies on 3rd party packages that may have been deprecated over the past years. We are slowly replacing these dependencies with newer, supported alternatives to resolve these warnings, however they are generally safe to ignore, since the CLI is never exposed to the public and it's only used for local development, where most of the security concerns don't apply.

Verifying the environment

To verify that the installation was successful, open a new Command Prompt window (to ensure the new environment variables are loaded) and run:

cli
ns doctor android

If you see No issues were detected then you have successfully set up your system.

Lastly, you will also want to set up an android device or emulator.

Troubleshooting

If any of the above failed, we recommend asking in our Community Discord for assistance.

Setting up Windows for iOS

❌ Unsupported

A Mac is required to build projects that use native iOS code. Simpler apps can be tested using NativeScript Preview.