web
mobile

Installation guide

Quick Start


Prerequisites

Before you use MDB React Mobile make sure You have installed Node.js (LTS version) and React Native CLI package. Remember to restart terminal after each installation.

To install React Native CLI, in Your command line type:

npm install -g nativescript

Note! On Windows systems you can only use the React Native 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.

System requirements
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 is C:\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/openjdk
    • brew 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-sdk
    • export 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 is C:\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 3:  Check the config

  • tns doctor

Note! On Linux systems you can only use the React Native 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.

System requirements
Ubuntu 14.04 LTS

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

Step 2:  Install the G++ compiler

  • sudo apt-get install g++

Step 3:  Install JDK 8

  • sudo apt-get install openjdk-8-jdk
  • sudo update-alternatives --config java
  • export 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 is C:\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

Basic installation

Step 1:  Download MDB React Mobile and unzip

Step 2:  Run terminal inside the project and type:

  • npm install
  • tns run android --bundle   or   tns run ios --bundle