Before you get started, make sure you have the following dependencies installed on your machine:
-
NodeJS
>=5
andnpm 3
. npm 2 is not supported. -
Homebrew (or an alternative way to install OSX packages)
-
Latest React Native CLI
$ npm install -g react-native-cli
Install dependencies
$ npm install
$ react-native link
- Install Requirements:
- Xcode for iOS development (download from Mac App Store)
- Ruby (>2.2) to run CocoaPods
- CocoaPods 1.0 or newer for iOS package management.
Please note that CocoaPods 0.x will not work, and at the time of writing the version in Homebrew is still 0.39, so check your pod --version
and install 1.0 with gem
if necessary.
-
Install native iOS dependencies
$ (cd ios; pod init; pod repo update; pod install)
-
Build the app and run the simulator via react-native:
$ react-native run-ios
In the case, that this error Print: Entry, ":CFBundleIdentifier", Does Not Exist
occurs on build, you may need to run react-native upgrade
to run the latest version of react-native.
-
Build the app and run on an iPhone via xcode:
-
Open
ios/T7Chicken.xcworkspace
with Xcode -
Plug in your device via USB cable
-
Change 'Iphone 7Plus' to your device
-
Click View->Navigators->Project Navigator
-
Scroll down to 'Signing' and add a signature. You will need an Apple developer account.
-
Click the 'Play' button to build and run on your device
More Information on running on a device
If you see a linker error when trying to build the app, close the project and make sure you open the .xcworkspace file and not the .xcodeproj file
More details here: React Native Android Setup
-
Install latest JDK
$ brew update $ brew upgrade $ brew cask install java $ brew install gradle ```
-
Install the Android SDK
$ brew install android-sdk
-
Set ANDROID_HOME environment variable in .bashrc, .zshrc or similar:
$ export ANDROID_HOME=/usr/local/opt/android-sdk
-
Start Android SDK Manager
$ android
-
Add SDK tools via Android sdk manager
- Android SDK tools
- Android SDK Platform-tools
- Android SDK Build-tools (Important: Rev. 23.0.1)
- SDK Platform
- Intel x86 Atom_64 System Image
- Intel x86 Atom System Image
- Android Support Repository
- Android Support Library
- Intel x86 Emulator Accelerator (HAXM installer)
- Android Studios
-
Configure and install hardware acceleration
$ open /usr/local/opt/android-sdk/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM_<version>.dmg
-
Open Android Virtual Device manager
$ android avd
-
Add new virtual device
- name: reactnative
- Device: Nexus 5
- Target: Android 6 - API Level 23
- CBU: Intel Atom x86
- check Use Host GPU
- Run Android Studios
- You will need to open the project's
/android
directory which will then have Android Studios configure the 'gradle' files in the project. These files are crucial to building the project for android testing.
-
Build app and run emulator:
$ react-native run-android
Feel free to clone or fork this repo if you'd like to make any changes. master branch
is the working branch, develop
is used for any changes. Make a branch off of develop
, once you confirm that your changes are good to go submit the Pull Request to develop
. From there we will merge into master after review.