# NonaTemplate :: Prerequisites & Setup <!-- omit in toc -->

## Table of Contents <!-- omit in toc -->

<!-- TOC -->

- [Common Prerequisites & Setup (iOS & Android)](#common-prerequisites--setup-ios--android)
- [iOS Prerequisites & Setup](#ios-prerequisites--setup)
  - [iOS Setup](#ios-setup)
  - [Install extensions](#install-extensions)
    - [Install Bundler](#install-bundler)
    - [Install Pods](#install-pods)
- [Android Prerequisites & Setup](#android-prerequisites--setup)
  - [Android Setup](#android-setup)
    [Android Prerequisites & Setup](#android-prerequisites--setup)
  - [Android Setup](#android-setup)
  <!-- /TOC -->

## Common Prerequisites & Setup (iOS & Android)

Minimal system dependencies to run the project:

- [Brew](https://brew.sh/)
- [Node & NPM](https://nodejs.org/en/) : `brew install node` or [install with NVM](https://github.com/creationix/nvm)
- [Watchman](https://facebook.github.io/watchman/) : `brew install watchman`
- react-native : `npm i -g react-native`
- circleci command line tool : on Mac `brew install circleci` or [alternative installation](https://circleci.com/docs/2.0/local-cli/#installation)

Install Ruby dependencies:

- `gem install bundler` # This may require sudo depending on your Ruby setup
- `bundle install`

**[⬆ back to top](#table-of-contents)**

## iOS Prerequisites & Setup

### iOS Setup

[Install XCode](https://developer.apple.com/xcode/)

Once XCode has been installed, make sure you check and install the ios version to greater than 11 on the simulator. You can do this by opening XCode, clicking XCode and clicking Preferences, choose components, finally, check that the ios version is greater than 13 on the simulator and install.

### Install extensions

#### Install Bundler

- `gem install bundler` # This may require sudo depending on your Ruby setup
- `bundle install`

#### Install Pods

```bash
cd ios
bundle exec pod install
cd ..
```

**[⬆ back to top](#table-of-contents)**

## Android Prerequisites & Setup

### Android Setup

For any links below please click through to them, as they contain additional steps you should follow.

1. [Install Android Studio](https://facebook.github.io/react-native/docs/getting-started.html#1-install-android-studio)

2. [Install the Android SDK](https://facebook.github.io/react-native/docs/getting-started.html#2-install-the-android-sdk)

3. [Install ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages)

4. Export android environment variables:

   ```bash
   export ANDROID_HOME=$HOME/Library/Android/sdk
   export PATH=$PATH:$ANDROID_HOME/emulator
   export PATH=$PATH:$ANDROID_HOME/tools
   export PATH=$PATH:$ANDROID_HOME/tools/bin
   export PATH=$PATH:$ANDROID_HOME/platform-tools
   ```

5. Setup Emulator

- Open Android Studio
- Click `Configure` in the bottom right of the screen
- Click `AVD manager`
- Once Android Studio has finished it's initialization, `AVD Manager` should be available under `Tools`
- Open `AVD Manager`
- Click `create new virtual device`
- Select target device
- Download required images
- `Finish` (you should now be able to start the app on the emulator using `npm run android`)

[reference](https://developer.android.com/studio/run/emulator)

**[⬆ back to top](#table-of-contents)**
