aodb/Readme/MacSetupGuide.md
Martin Donnelly afe73b5baa upload
2016-12-22 00:00:06 +00:00

13 KiB
Raw Permalink Blame History

AODB Mobile Mac

Background

This guide is designed to set up and install all the components required for a development, automated build and continual integration environment on Mac OS X.

Prerequisites

Access to the team foundation server for the AODB Mobile project which contains the git repository and project documentation. Transport AODB Mobile Team Foundation Server

Access to the AODB Mobile project Thycotic Secret Server which contains all account information, usernames and passwords. Transport AODB Mobile Thycotic Secret Server

Access to the Apple developer account which is used for setting up provisioning profiles, device management and certificates. Apple Developer Account


Contents

Install and configure the following components:l


Rename Computer

Rename computer name using central technology asset id.

Asset ID: LM120477

  • Launch System Preferences from the Apple menu in OS X
  • Click the Sharing icon
  • Type in what you want your Macs new computer name to be
  • Close System Preferences for the setting to take effect

Sophos

Sophos Endpoint doesnt rely on signatures to catch malware, which means it catches zero-day threats without adversely affecting the performance of your device. So you get protection before those exploits even arrive.

Raise Assist with CT for adding Sophos Endpoint

Java SDK

The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime

Download and install the Java Platform, Standard Edition Java SE Downloads

Set $JAVA_HOME environment variable with the following command in the terminal prompt:

$ emacs .profile

Add this to the end of the .profile file:

JAVA_HOME=/Library/Java/Home
export JAVA_HOME;

Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)

Confirm Java verion with the following command in the terminal prompt:

$ java -version

Xcode

Xcode is an integrated development environment (IDE) containing the tools for developing iOS.

Install Xcode with the following command in the terminal prompt:

$ xcode-select --install

Add MobileAppsTeam Developer Account to Xcode

iOS developer certificates

Apple Developer

  • Log into Apple Developer Account with MobileAppsTeam@leidos.com;
  • Download iOS developer certificates;
  • Open downloaded certificates in Keychain;
  • Ensure Xcode has logged has the developer account logged in.

Homebrew

Homebrew is a open-source software package management.

Install Homebrew with the following command in the terminal prompt:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Confirm the Homebrew installed with the following command in the terminal prompt:

$ brew doctor

Homebrew documentation


Git

Git is a version control system. Must be version >= 2.9.0

Install Git with the following command in the terminal prompt:

$ brew install git

Confirm the version of Git with the following command in the terminal prompt:

$ git --version

OpenSSL

OpenSSL is an open source tool for using the Secure Socket Layer (SSL) and Transport Layer Security (TLS) protocols for Web authentication.

Install OpenSSL with the following command in the terminal prompt:

$ brew install openssl

Ensure folder exists on machine with the following commands in the terminal prompt:

$ mkdir -p /usr/local/lib/
$ ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
$ brew link --force openssl
$ brew info openssl

Visual Studio Team Services Agent

The Visual Studio Team Services Agent OSX is cross platform build and release agent for Team Services and Team Foundation Server 2015

Download the OSX agent

Download vsts-agent-osx.10.11-x64-2.105.7.tar.gz

Create OSX agent folder in the $HOME with the following command in the terminal prompt:

$ cd $HOME
$ mkdir aodb-vsts-agent && cd aodb-vsts-agent

Extract into agent folder from Downloads with the following command in the terminal prompt:

$ tar xzf ~/Downloads/vsts-agent-osx.10.11-x64-2.105.7.tar.gz

Configure the agent

Configure the agent with the following command in the terminal prompt:

$ cd $HOME/aodb-vsts-agent
$ ./config.sh

Enter the following details as below:

Enter Server URL > http://i-t-v-tf01:8080/tfs Enter authentication type (press enter for Negotive) > Enter user name > I-T-V-TF01/GITUSER Enter Password > Transport AODB Mobile Thycotic Secret Server Enter queue name > Chroma vNext Enter agent name > Mac-LM120477 Default any other settings

Run the agent with the following command in the terminal prompt:

$ ./run.sh

Remove the agent to reconfigure with the following command in the terminal prompt:

$ ./config remove

Visual Studio Team Services Agent Documentation


Node Version Manager

Node Version Manager is bash script to manage multiple active node.js versions

Install NVM with the following command in the terminal prompt:

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

Add NVM to the bash_profile with the following command in the terminal prompt:

$ nano ~/.bash_profile

Add the following lines to the .bash_profile :

export PATH=$PATH:~/.android-sdk-macosx/platform-tools/ export NVM_DIR="/Users/MobileAppsTeam/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

Verify installation with the following command in the terminal prompt:

$ nvm -v

Node Version Manager Documentation


Node

Node.js is an open-source, cross-platform JavaScript runtime environment.

Install Node and NPM with the following command in the terminal prompt:

$ nvm install 6.9.0
$ npm i -g npm@3.10.7
$ nvm use 6.9.0
$ nvm alias default 6.9.0

Verify Node version 6.9.0 and npm version 3.10.7 with the following command in the terminal prompt:

$ node -v && npm -v

Node Packages

Install the following node packages with specified versions

  • gulp
  • cordova
  • ionic
  • jspm
  • bower
  • npm-check
  • npm-install-missing
  • phantomjs-prebuilt
  • sinopia
  • pm2

Install Node Packages with the following command in the terminal prompt:

$ npm i -g gulp cordova ionic jspm bower npm-check npm-install-missing phantomjs-prebuilt sinopia pm2

List installed Node Packages with the following command in the terminal prompt:

$ npm ls -g --depth=0

Sinopia

Sinopia is a private / caching npm repository server

Install Sinopia with the following command in the terminal prompt:

$ npm i sinopia -g

Run Sinopia with the following command in the terminal prompt:

$ sinopia

Set npm registry to Sinopia with the following command in the terminal prompt:

$ npm set registry http://localhost:4873/

Set add user to Sinopia with the following command in the terminal prompt:

$ npm adduser --registry http://localhost:4873/

Username: mobileappsteam Password: Transport AODB Mobile Thycotic Secret Server Email: MobileAppsTeam@leidos.com

Clone local-Chromaux git repository with the following commands in the terminal prompt:

$ cd $HOME/dev
$ git clone http://i-t-v-tf01:8080/tfs/Transport/Chroma%20Refresh/_git/UX

Run the gulp command to export Chroma.UX with the following commands in the terminal prompt:

$ cd $HOME/dev/UX/Chroma.UX/
$ npm install
$ gulp newexport

Check the npm config file has the value registry=http://localhost:4873/ with the following command in the terminal prompt:

$cat ~/.npmrc

Publish the Chroma.UX package to Sinopia with the following commands in the terminal prompt:

$ cd $HOME/dev/UX/local-chromaux/
$ npm publish .

Sinopia Documentation


PM2 Process Management

PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.

Install PM2 with the following command in the terminal prompt:

$ npm i pm2@latest -g

Setup Auto-Completion with the following command in the terminal prompt:

$ pm2 completion >> ~/.bash_profile

Create a process configuration JSON file as ~/process.json

{
    "apps" : [
        {
            "name" : "Sinopia",
            "script" : "/Users/MobileAppsTeam/.nvm/versions/node/v4.4.7/bin/sinopia",
            "cwd" : "/Users/MobileAppsTeam",
            "watch" : false,
            "instances" : 1,
            "exec_mode" : "fork",
            "combine_logs" : true,
            "max_memory_restart" : "300M",
            "restart_delay" : 5000
         },
        {
            "name" : "BuildAgent",
            "script" : "run.sh",
            "cwd" : "/Users/MobileAppsTeam/aodb-vsts-agent",
            "watch" : false,
            "instances" : 1,
            "exec_mode" : "fork",
            "combine_logs" : true,
            "max_memory_restart" : "300M",
            "restart_delay" : 5000
         }
    ]
}

Start with the following command in the terminal prompt:

$ pm2 start ~/profile.json

Additional Commands

$ pm2 kill
$ pm2 monit
$ pm2 list
$ pm2 log 0
$ pm3 log 1

PM2 documentation


Android command line SDK Tools

SDK Tools is a downloadable component for the Android SDK. It includes the complete set of development and debugging tools for the Android SDK.

Download the Mac SDK Tools android-sdk_r24.4.1-macosx.zip

Unzip Android command line SDK Tools with the following commands in the terminal prompt:

$ cd ~/Downloads/
$ unzip android-sdk*.zip
$ mv android-sdk-macosx/ ~/.android-sdk-macosx

Run the SDK Manager with the following commands in the terminal prompt:

$ sh ~/.android-sdk-macosx/tools/android

Select the following below:

Tools

  • Android SDK Build-tools 23.03
  • Android SDK Build-tools 23.02
  • Android SDK Build-tools 23.01
  • Android SDK Build-tools 22.01

Android 6.0 (API 23)

  • SDK Platform
  • Google APIs Intel x86 Atom_64 System Image
  • Sources for Android SDK

Click Install Packages

Add platform-tools to your path with the following commands in the terminal prompt:

$ echo 'export PATH=$PATH:~/.android-sdk-macosx/platform-tools/' >> ~/.bash_profile

Refresh your bash profile with the following commands in the terminal prompt:

$ source ~/.bash_profile

Android Developer Website


WebStorm

WebStorm is a JavaScript IDE for client-side development and server-side development with Node.js.

Download WebStorm for Mac OS

WebStorm Website


SourceTree

SourceTree is a Git and Hg client. SourceTree simplifies how you interact with your Git and Mercurial repositories.

Download SourceTree


Visual Studio Code

Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring.

Download Visual Studio Code


Tinker Tools

TinkerTool is an application that gives you access to additional preference settings Apple has built into macOS. This allows to activate hidden features in the operating system and in some of the applications delivered with the system

Download Tinker Tools

Brackets

Brackets is an open source code editor for web designers and front-end developers.

Download Brackets

Chrome

Chrome is a fast, simple and secure web browser, built for the modern web. Download Chrome.

Download Chrome


TO ADD

screen

How To Use Linux Screen

Control Command Command: “Ctrl-a”

Switching Between Windows

Command: “Ctrl-a” “n”

Detaching From Screen

Command: “Ctrl-a” “d”