NativeScript Advanced Setup: Linux

This page contains a list of all system requirements needed to build and run NativeScript apps on Linux, as well as a guided walkthrough for getting these requirements in place.

NOTE: On Linux systems you can only use the NativeScript CLI to develop Android apps. This is because the NativeScript CLI uses Xcode to build iOS apps, which is only available on the macOS operating system. If you’re interested in building iOS apps on Linux, you may want to try out the Telerik Platform. The Telerik Platform provides robust tooling for NativeScript apps, including a service that performs iOS and Android builds in the cloud, removing the need to complete these system requirements, and allowing you to build for iOS on Linux.

System Requirements

  • Ubuntu 14.04 LTS
  • The latest stable official release of Node.js (LTS) 6.x
  • G++ compiler
  • JDK 8 or a later stable official release
  • Android SDK 22 or a later stable official release
  • Local Maven repository for Support Libraries
  • Android SDK Build-tools 25.0.2 or a later stable official release

You must also have the following two environment variables setup for Android development:


Advanced Setup Steps

Complete the following steps to set up NativeScript on your Linux development machine:

  1. Install the latest Node.js 6.x or 7.x stable official release. We recommend using Node.js v6.x.

  2. If you are running on a 64-bit system, install the runtime libraries for the ia32/i386 architecture.

    sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386

    If you encounter an error showing "Unable to locate package lib32bz2-1.0" then use

    sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 libstdc++6:i386
  3. Install the G++ compiler.

    sudo apt-get install g++
  4. Install JDK 8 or a later stable official release.

    1. Run the following commands.

      sudo apt-get install python-software-properties
      sudo add-apt-repository ppa:webupd8team/java
      sudo apt-get update
      sudo apt-get install oracle-java8-installer
    2. After installation if you have multiple installations of java you can choose which to use:

      sudo update-alternatives --config java
    3. Set the JAVA_HOME system environment variable.

      export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
  5. Install the Android SDK.
    If you experience issues with the installation, go to Installing the Android SDK, expand the Show instructions for all platforms section, expand the Troubleshooting Ubuntu section and review the troubleshooting guide.

    1. Go to Android Studio and SDK Downloads and in the SDK Tools Only section download the package for Linux.
    2. After the download completes, unpack the downloaded archive.
    3. Set the ANDROID_HOME system environment variable.
      export ANDROID_HOME=Path to Android installation directory
      For example: ANDROID_HOME=/android/sdk/
      NOTE: This is the directory that contains the tools and platform-tools directories.
  6. Install the required Android SDKs and the Local Maven repository for Support Libraries.

    sudo $ANDROID_HOME/tools/android update sdk --filter tools,platform-tools,android-25,build-tools-25.0.2,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui
  7. Setup Android Emulators (AVD) by following the article here

  8. Install the NativeScript CLI.

    1. Run the following command.
    sudo npm install nativescript -g --unsafe-perm
    1. Restart the command prompt.
  9. To check if your system is configured properly, run the following command.

    tns doctor

What’s Next

Stay connected with NativeScript

(expect a newsletter every 4-8 weeks)

NativeScript is licensed under the Apache 2.0 license .
© 2016 Progress Software Corporation. All Rights Reserved.