This tutorial will describe how you can run and test the app on your own computer (Mac only, sorry ๐)
- (1) Prerequisites
- (1.1) Installing Xcode
- (1.2) Installing homebrew
- (1.3) Installing npm
- (1.4) Installing Apache Cordova
- (1.5) Installing git
- (2) Cloning the app code
- (3) Emulating the app on iOS
In order to emulate the app, you will need to install all of the following on your Mac:
-
Xcode - Apple's integrated development environment for Mac
-
homebrew - an excellent package manager for Mac OS, will be used to install npm
-
npm - node package manager - will be used for the installation of other components
-
Apache Cordova - a platform with a command line tool for building HTML/JS/CSS apps for mobile devices
-
git - a source control system that allows you to collaborate on this project
Keep in mind that Xcode takes ~5GB of your hard drive's space. Go to Apple's app store and install Xcode (use this link).
After the installation is completed, open the Xcode app to simply accept the license agreement.
After accepting the license agreement, there's only one step you need to take:
- Open your terminal (CMD + T and type
terminal
) - Paste the following command and hit ENTER:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Type in your password when prompted to, and that's it.
Open your terminal (CMD + T and type
terminal
).First let's check if you already have homebrew installed on your Mac:
Within the terminal, paste the following command:
brew ls -l
If the output is something along the lines of
command not found: brew
, then you should carry on as mentioned below.Within the terminal, paste the following command and follow the instructions.
You might be prompted to insert your password (it's the same password you use to log into your Mac).
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Hit enter and follow the instructions.
Open your terminal (CMD + T and type
terminal
+ ENTER), then just type the following command and press ENTER.brew update
Then run the following command and press ENTER.
You might be prompted to insert your password (it's the same password you use to log into your Mac).
brew install node
Open your terminal (CMD + T and type
terminal
+ ENTER), then just type the following command and press ENTER:You will be prompted to insert your password (it's the same password you use to log into your Mac).
sudo npm install -g cordova
Open your terminal (CMD + T and type
terminal
+ ENTER), then just type the following command and press ENTER:brew install git
- Open your terminal (CMD + T and type
Now that you have installed all of the required package managers and the required software, you can clone the app.
Open your terminal and browse to a folder where you would like to download the app.
For instance, if you would like to create a folder for projects workspace named workspace
, use the mkdir
command to create a folder and cd
command to change the folder you are currently in:
# here we are creating a new folder under the home folder:
mkdir ~/workspace
# now we are switching the working directory to it:
cd ~/workspace
Next, let's use the newly installed git tool to clone the app from this repository:
git clone https://github.com/yuvalherziger/jrp-team-1-app-ios.git
After the numbers finish crunching, you will have a new folder named jrp-team-1-app-ios in place. Let's go ahead and change the working directory to the root app directory:
cd jrp-team-1-app-ios
Now for the fun part ๐
While in the jrp-team-1-app-ios working directory, type the following command:
cordova platforms add ios
cordova build ios
This command just built an ios app that's ready to be emulated. Lastly, let's run the app on the emulator:
cordova emulate ios