NativeScript Advanced Setup: macOS

This page contains a list of all system requirements needed to build and run NativeScript apps on macOS, as well as a guided walkthrough for getting these requirements in place. On macOS systems, you can use the NativeScript CLI to develop Android and iOS apps.

System Requirements

  • macOS Mavericks or later
  • The latest stable official release of Node.js (LTS) 6.x
  • (Optional) Homebrew to simplify the installation of dependencies
  • For iOS development
    • Latest Xcode
    • Command-line tools for Xcode
    • xcodeproj ruby gem
    • CocoaPods
    • (Optional) xcproj command line tool
  • For Android development
    • 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 setup NativeScript on your macOS development machine:

  1. Install Homebrew to simplify the installation process.

    ruby -e "$(curl -fsSL"
  2. Install the latest Node.js 6.x or 7.x stable official release. We recommend using Node.js v6.x.

    brew update
    brew install node@6
  3. Install the dependencies for iOS development.

    1. Run the App Store and download and install Xcode 5 or later.
    2. Go to Downloads for Apple Developers, log in and download and install the Command Line Tools for Xcode for your version of macOS and Xcode.
    3. Install the xcodeproj ruby gem with the following command.

      sudo gem install xcodeproj
    4. Install CocoaPods

      sudo gem install cocoapods
    5. (Optional) If you are using Xcode 7.3 as well as an older version of CocoaPods (0.39.0 or earlier), you must install the xcproj command-line tool by running brew install xcproj in your terminal. You can check your CocoaPods version with pod --version.

      brew install xcproj
  4. Install the dependencies for Android development.

    1. Install JDK 8 or a later stable official release.
      1. Go to Java SE Downloads and click Download for JDK.
      2. In the Java SE Development Kit section, accept the license agreement and click the download link for Mac macOS.
      3. Wait for the download to complete and install the JDK.
    2. Set the JAVA_HOME system environment variable.

      export JAVA_HOME=$(/usr/libexec/java_home)
    3. Install the Android SDK.

      1. In the terminal, run the following commands:

        brew cask install android-sdk
      2. Next, run the following command to set the ANDROID_HOME system environment variable:

        export ANDROID_HOME=/usr/local/opt/android-sdk
        NOTE: This is the directory that contains the tools and platform-tools directories.
      3. Select all packages for the Android 22 SDK, Android SDK Build-tools 23.0.3 or later, Local Maven repository for Support Libraries (under Extras) and any other SDKs that you want to install and click Install. You can alternatively use the following command, which will install all required 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
  5. Setup Android Emulators (AVD) by following the article here

  6. Install the NativeScript CLI.

    1. Run the following command.

      npm i -g nativescript
    2. Restart the command prompt.

  7. 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.