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 public preview of NativeScript Sidekick. NativeScript Sidekick 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
- Android Support Repository
- (Optional) Google Repository
- 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.
- Go to Android Studio and SDK Downloads and in the SDK Tools Only section download the package for Linux at the bottom of the page.
- 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 all packages for the Android SDK Platform 25, Android SDK Build-Tools 25.0.2 or later, Android Support Repository, Google Repository and any other SDKs that you may need. You can alternatively use the following command, which will install all required packages.
sudo $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-25" "build-tools;25.0.2" "extras;android;m2repository" "extras;google;m2repository"
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.