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.
- 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:
Complete the following steps to set up NativeScript on your Linux development machine:
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
Install the G++ compiler.
sudo apt-get install g++
Install JDK 8 or a later stable official release.
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
After installation if you have multiple installations of java you can choose which to use:
sudo update-alternatives --config java
Set the JAVA_HOME system environment variable.
export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
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.
- Go to Android Studio and SDK Downloads and in the SDK Tools Only section download the package for Linux.
- After the download completes, unpack the downloaded archive.
- Set the ANDROID_HOME system environment variable.
For example: ANDROID_HOME=/android/sdk/
export ANDROID_HOME=Path to Android installation directory
NOTE: This is the directory that contains the
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
Setup Android Emulators (AVD) by following the article here
Install the NativeScript CLI.
- Run the following command.
sudo npm install nativescript -g --unsafe-perm
- Restart the command prompt.
To check if your system is configured properly, run the following command.