Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Setting Up Your Development Environment on OS X Machines
Installing Cordova and SDKs on OS X
Although most of the instructions needed to install Apache Cordova and SDKs for iOS and Android on an OS X machine are available here, some of the Android installation instructions are difficult to follow and are a bit out of date. Thus, we decided to create our own installation instruction page by adapting some of the instructions provided on this page and this page.
- Install Node.js. Download installer here and run the downloaded installation file.
- To test whether the installation was successful, open a terminal window. On a Mac, it will be under Application > Utilities > Terminal. You can also search for Terminal in Spotlight, using the shortcut Cmd + Spacebar. Once Terminal is open, type
If the version number is displayed, your installation was successful.
- Install Git. Download the installer here. When you run the downloaded installation file, you may see a warning about how you cannot open it because it is from an unidentified developer or that it cannot be opened because it was not downloaded from the Mac App Store, depending on the settings you have. To circumvent this warning, go to System Preferences > Security and Privacy > General tab. Under the Allow applications downloaded from header, there should an option that allows you to install git.
- Install Cordova by going to your Terminal window and typing the following command:
sudo npm install -g cordova
- You can test whether your installation was successful by typing the following command in Terminal:
Just like when you installed node, if you see a version number, it means you have successfully installed Apache Cordova.
Install Xcode for iOS development
- To access Xcode, you will need to have an Apple ID. If you do not have have one, you can sign up for one for free here.
- To actually distribute your app to your participants, however, you will need to sign up for one of the iOS Developer Programs. We recommend the Enterprise program. You can find out more details about the different Apple Developer Programs here. We also discuss the various programs in relation to ExperienceSampler in our manuscript on page 12 and in our online tutorial. We recommend starting this process while you are customizing your app.
- Download and install Xcode from this page 4a. When the installation is complete, open Xcode and enable command line tools for Xcode using the following instructions:
- Go to Xcode > Preferences
- Select Downloads tab
- Under Components, locate Command Line Tools and click the download icon
4b. You can also install Xcode through Terminal by running the following commands:
xcode -select --install
Next install the deployment tools, which let you test your iOS apps on iOS devices from the command-line
npm install -g ios-deploy
- To check whether Xcode has been successful installed, go to Terminal and type the following code:
If the next line says
usr/bin/g++, then you have successfully installed Xcode.
Install the Android SDK
To develop Android apps, you will need to install Java, the Ant build tool, and the Android SDK
- First, check whether Java is already installed on your Mac. Go to Terminal and type
If you see a version number at or above 1.6, you should be good to go.
- If Java is not installed, download the Java Installer here. Select the latest version that is compatible with your OS version.
To install Ant, you will need to install Homebrew
- First, check whether you have Ant installed, by typing the following command in Terminal
If you see a version number, Ant is already installed.
- Then check whether you have Homebrew installed:
If you see a version number, Homebrew is already installed.
- If you have Homebrew installed, but not Ant, you can install Ant from Terminal using the following command:
brew install ant
- If neither Homebrew nor Ant is installed, you can install both with the following command in Terminal:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install ant
- Once installation is complete, check that the installation has been successful:
Install Android Development Tools (ADT)
There are several ways to install the Android Development Tools.
The easiest way is to simply install using Homebrew; however, we do not currently recommend this method because the latest version of the Android SDK has deprecated a key command, and we have not yet figured out how to implement the new command. Thus, we currently recommend using the Manual Method.
Manual Installation of ADTs
- Download an Android SDK that was released before March 2017. To determine what version you should download, see the release notes. We recommend installing version 25.2.5 at this time. You can download this version of the Android SDK here
- Unzip the file. Then go to Application and create a folder named Android-Development. Be sure to include the dash between Android and Development. Inside your Android-Development folder, create a folder named sdk. Drag and drop your unzipped tools folder into the Application > Android-Development > sdk folder.
- Now you have to tell your computer where your Android Tools are located by updating your .bash_profile. First, check whether you have a .bash_profile already created. First change your directory to your home directory by typing the following commands into Terminal:
- If a file opens in TextEdit then you can skip this step. Otherwise, you have to create a .bash_profile using the following commands:
- Type the following lines in your .bash_profile:
- Save the file and close it.
- Quit and restart Terminal. Once terminal has restarted, type the following command:
source ~/.bash_profileIf the next line loads a blank line, then you have been successful. Now you can build your Android apps. The first time you use the
cordova buildcommand will take a while because you will have to install the Build tools. To install these tools, type the command
android update sdk --no-ui --all --filter build-tools-25.0.1,android-25,extra-android-m2repository. This command should install all the additional tools you will need.