Setup Nativescript MacOS¶
The Peek platform is designed to run on Linux, however, it is compatible with macOS. Please read through all of the documentation before commencing the installation procedure.
This Installation Guide contains specific macOS operating system requirements for the configuring of synerty-peek.
This install procedure requires software installed by the prerequisites steps.
- Android Studio
- Geny Motion
Below is a list of all the required software:
- nativescript NPM package
Dependencies for iOS development¶
Install the xcodeproj ruby gem with the following command.
sudo gem install xcodeproj
sudo gem install cocoapods
Dependencies for Android development¶
Android Studio is required if you intend to develop the Android NativeScript app.
Launch the Android Studio DMG file.
Drag and drop Android Studio into the Applications folder, then launch Android Studio.
Select whether you want to import previous Android Studio settings, then click OK.
The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.
- If you want to run the SDK tools virtual emulator, check the following, or leave them unchecked
- if you want to use Geny Motion.
|Check:||Android Virtual Device|
If you’re install inside a virtual machine you’ll get the following message during the installation of Android Studio.
Unable to install Intel HAXM HAXM doesn’t support nested virtual machines. Unfortunately, the Android Emulator can’t support virtual machine acceleration from within a virtual machine.
In the Android Manager Welcome screen open the
Configure drop down at the bottom of the window and select
Go to the
SDK Platforms tab
At the bottom of the window:
In the list:
|Uncheck:||Unselect the other APIs|
Go to the
SDK Tools tab
At the bottom of the window:
In the list:
|Check:||Android SDK Build-Tools
|Uncheck:||Unselect the other versions.|
Select ‘ok’ and confirm the install
Close Android Studio
Install the required NPM packages
Create android dummy repositories file:
Create symlinks for NativeScript install:
ln -s /Users/peek/Library/Android/sdk /usr/local/opt/android-sdk # Find the version of java that you have: ls -d /Library/Java/JavaVirtualMachines/jdk1.8.0_* # Set the version of java or just leave this as * if there is only one. sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk/Contents/Home /Library/Java/Home
~/.bash_profile and insert the following after the first block comment.
Make sure these are before any lines like:
# If not running interactively, don't do anything
##### SET THE ANDROID ENVIRONMENT ##### export ANDROID_HOME="/Users/peek/Library/Android/sdk"
Close and reopen the terminal to ensure the profile takes effect.
Run the following command in a new terminal:
npm -g install nativescript@latest typescript tslint node-sass
Do you want to run the setup script?
Do you have Xcode installed (Xcode was installed during the OS Requirements Setup)?
software license agreements:
Allow the script to install Homebrew?
Allow the script to install Java SE Development Kit?
Allow the script to install Android SDK?
Allow the script to install CocoaPods?
Allow the script to install xcodeproj?
Do you want to install Android emulator?
Check the installation with
tns in a new terminal:
At this point you may find your self in a real life infinite loop. as tns doctor may ask you to run the setup script again if the setup is broken.
Android Emulator Setup¶
You can use any emulator. Synerty has written instructions for GenyMotion.
If you’ve setup your development console in a VM, you’ll need to install the Android emulator on the host machine. Skip to these instructions: Android Emulator Setup for VM.
Download and Install VirtualBox
Install GenyMotion, all default options
Create Android device
- Select the ‘Add’ button to create a virtual device
- Select a device and select next
- Update the “Virtual device name” to something shorter (easier to remember and type) and select next
Your virtual device will be retrieved and deployed
ABD Tool Connection Settings
- Select ‘Settings’
- Select the ‘ABD’ tab
- Check the ‘Use custom Android SDK tools’
- Confirm the the Android SDK tools are found successfully
With a device selected in the “Your virtual devices” list select the “Start” button
Your device emulation will start in a new window
In a terminal run
tns device to check tns can find your device.
Android Emulator Setup for VM¶
If you’ve setup your development console in a VM, you’ll need to install the Android emulator on the HOST MACHINE.
Follow the Android Emulator Setup instructions on the host machine then continue the following these instructions.
If you are NOT using a VM these instructions are not required.
Go to the HOST MACHINE.
With your emulator device started, run the following commands in terminal:
adb shell ifconfig adb tcpip 5556
Go to the VM and run the following commands in terminal.
Install Android Platform Tools:
brew cask install android-platform-tools
Connect to your genyMotion device:
adb connect <ip_of_genymotion>:5556
List attached devices:
Change to the
build_ns directory, check that tns can find the device: