Installation guide
5 min Quick Start
Prerequisites
- latest Node.js LTS
- NativeScript CLI
To install NativeScript CLI, use following command in your command line:
npm install -g nativescript
Full setup
Note! On Windows system you can only develop Android apps. In order to build iOS app you need to use tools available only on macOS.
Prerequisites:
- Windows 7 Service Pack 1 or later
Step 1: Install Chocolatey
- Launch the command prompt as an Administrator
-
Run the following script:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin - Restart the command prompt
Step 2: Setup JDK 8
choco install adoptopenjdk --version 8.192
Step 3: Install Android SDK
choco install android-sdk -y- Restart the command prompt
Step 4: Install all necessary tools for Android SDK Platform
"%ANDROID_HOME%\tools\bin\sdkmanager" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository"
Step 5: Setup Android Emulator (AVD)
- Run terminal in the following directory:
$ANDROID_HOME/tools/bin. $ANDROID_HOME means the default android path. For example on Windows it isC:\Android\android-sdk - Download an image using sdkmanager:
sdkmanager "system-images;android-28;google_apis;x86" - Create an AVD:
avdmanager create avd -n Android28 -k "system-images;android-28;google_apis;x86"
Step 6: Check the config
tns doctor
System requirements:
- macOS High Sierra or later
Step 1: Install Homebrew
-
Run the following script:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step 2: Install the dependencies for iOS development
- Run the App Store and download Xcode
- Start Xcode and you will be prompted to install Command Line Tools for Xcode
- Install the xcodeproj ruby gem with the following command:
sudo gem install xcodeproj - Install CocoaPods
sudo gem install cocoapods - Setup CocoaPods
pod setup - Install python six package
pip install six
Step 2: Install the dependencies for Android development
- Setup JDK8
brew tap AdoptOpenJDK/openjdkbrew cask install adoptopenjdk8
- Set the JAVA_HOME system environment variable
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
- Install the Android SDK
brew cask install android-sdkexport ANDROID_HOME=/usr/local/share/android-sdk
- Install all necessary tools for Android SDK Platform
$ANDROID_HOME/tools/bin/sdkmanager "tools" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository"
- Setup Android Emulators
- Run terminal in the following directory:
$ANDROID_HOME/tools/bin. $ANDROID_HOME means the default android path. For example on Windows it isC:\Android\android-sdk - Download an image using sdkmanager:
sdkmanager "system-images;android-28;google_apis;x86" - Create an AVD:
avdmanager create avd -n Android28 -k "system-images;android-28;google_apis;x86"
- Run terminal in the following directory:
Step 3: Check the config
tns doctor
Note! On Linux system you can only develop Android apps. In order to build iOS app you need to use tools available only on macOS.
System requirements:
- Ubuntu 14.04 LTS or later
Step 1: 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
Package lib32ncurses5 is only available as version 6 on Ubuntu >v.19.04, replace with lib32ncurses6.
Step 2: Install the G++ compiler
sudo apt-get install g++
Step 3: Install JDK 8
sudo apt-get install openjdk-8-jdksudo update-alternatives --config javaexport JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
Step 4: 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 into a folder, such as /usr/local/android/sdk
- Set the ANDROID_HOME environment variable. Open ~/.bashrc and add the following:
export ANDROID_HOME="/usr/local/android/sdk/"export PATH="${PATH}:${ANDROID_HOME}tools/:${ANDROID_HOME}platform-tools/"- In a text file which was opened, paste in the path to your variable (at the new line). For example: ANDROID_HOME=/usr/local/android/sdk.
- Logout from current user and login again so environment variables changes take place.
Step 5: Install all necessary tools for Android SDK Platform
sudo $ANDROID_HOME/tools/bin/sdkmanager "tools" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository"
Step 6: Setup Android Emulator (AVD)
- Run terminal in the following directory:
$ANDROID_HOME/tools/bin. $ANDROID_HOME means the default android path. For example on Windows it isC:\Android\android-sdk - Download an image using sdkmanager:
sdkmanager "system-images;android-28;google_apis;x86" - Create an AVD:
avdmanager create avd -n Android28 -k "system-images;android-28;google_apis;x86" - After creating an emulated device you need to:
- Enable its Developer mode - go to Settings -> About emulated device and tap 7 times on Build number
- Enable USB debugging - go to Settings -> Developer options and enable USB Debugging
Step 7: Check the config
tns doctor
Installation
Prerequisites: Prepare your development environment as described in the full setup section.
Step 1: Download Angular Mobile Kit from Your Orders (inside MDB BUNDLE)
Step 2: Open the app in your code editor and run following commands in the terminal:
npm installtns run android --bundleortns run ios --bundle
