A React Native project
- React Native CLI
- watchman
- node/npm
- yarn (optional for package manager)
- Android studio and packages for Android
- Xcode for iOS
- Clone repo to local drive
- Use terminal or command prompt and get to project root folder
- Install project libraries via
npm i
oryarn
- Go to project root folder
- run
react-native run-ios
- Simulator should start and app will install and react packager will launch as well
- Connect device to xcode
- Make sure device is registered on xcode and dev is enabled
- Open project workspace from ios folder
- Select device from Xcode
- Run on device
- Run
npm start
to run Metro Bundler - Launch android studio
- Launch an android emulator
- Go to project root folder
- Run
react-native run-android
- Simulator should start and app will install and react packager will launch as well
- Connect device via USB
- Use terminal and run
adb devices
this will connect your device to the pc - Go to project root folder
- Run
react-native run-android
- App will install onto device
- When app is running in debug mode
- Activate remote js debug via app
- Chrome will launch, open Console
- When app is running in debug mode
- Activate remote js debug via app
- use react-devtools
- Launch Xcode, open project workspace file in ios folder
- Update build number
- Archive, when complete organizer will launch showing where the file is
- Update version build number
- Use android studio to open android folder
- Click on Generate signed apk
- When built successfuly apk file will be placed in app/build/output/ folder
- Update version build number
- Go to project root folder
- run
cd android && ./gradlew assembleRelease && cd ..
oryarn release-android
- When built successfuly apk file will be placed in app/build/output/ folder
Login to hockey, select android build, add version, upload apk file
- Locate the dependency, do you really need it?
- If yes, go to project folder
- Use
npm i package-name --save
oryarn add package-name
to install package - Majority of packages will use
react-native link package-name
to link the package - Some packages might have extra manual setup steps
Do I need to keep my react packager open? Yup. App built without release mode requires react packager on the same network.
Can I have multiple react packager instance launched? Nope. Each project can only run 1 instance due to port limitations.
Can I run different projects with a single react packager instance? Nope. Packager must be in the same folder as the project you are running.
After installing app on device, app wouldn't run after disconnecting USB or network. When running on device, app isn't installed fully and requires react packager to work.
Android or iOS Build fails Check build log for errors, common issues are missing dependancies or error in coding.
592 android pixel 683/731 android pixel xl, nexus 5x, pixel 2 765/823 android pixel xl 2 568 ios se 667 ios 6 736 ios 6+ 812 ios x