Prerequisites
Before running the app, ensure you’ve completed:- ✅ Prerequisites - Node.js, Ruby, and tools installed
- ✅ Installation - Dependencies installed with
yarn install && yarn setup - ✅ iOS Setup or Android Setup - Platform-specific configuration
Development Workflow
The typical development workflow involves two steps:- Start Metro Bundler - JavaScript bundler (like webpack for React Native)
- Run on Platform - Build and launch on iOS/Android
Start Metro Bundler
In one terminal, start the Metro bundler:Keep Metro running in this terminal while developing. It watches for file changes and provides hot reload.
Running on iOS
- Command Line (Recommended)
- Xcode
- Physical Device
Run from terminal:This:
- Builds the app with Xcode
- Launches iOS Simulator
- Installs and runs Rainbow
Running on Android
- Command Line (Recommended)
- Android Studio
- Physical Device
Run from terminal:This:
- Builds the app with Gradle
- Launches emulator (if not already running)
- Installs and runs Rainbow
Make sure you have an emulator created or a physical device connected before running.
Development Features
Hot Reload
When Metro is running, changes to JavaScript/TypeScript files automatically reload:- Fast Refresh: Preserves component state while reloading
- Automatic: Saves the file, app updates
Fast Refresh works for most React components. Some changes (like adding new native modules) require a full rebuild.
Developer Menu
Access the developer menu:- iOS Simulator: Press Cmd+D
- Android Emulator: Press Cmd+M (macOS) or Ctrl+M (Windows/Linux)
- Physical Device: Shake the device
- Reload
- Debug
- Enable/disable Fast Refresh
- Toggle Element Inspector
- Show Performance Monitor
Remote Debugging
React DevTools
Install standalone React DevTools:Chrome DevTools (Legacy)
In developer menu, select Debug to open Chrome DevTools.Flipper
Flipper is a debugging platform for mobile apps:- Download Flipper: https://fbflipper.com/
- Build app with Flipper enabled (default)
- Open Flipper while app is running
- Network inspector
- React DevTools
- Logs viewer
- Layout inspector
Element Inspector
Inspect UI elements:- Open developer menu
- Select Toggle Element Inspector
- Tap elements to see details (styles, props, etc.)
Environment-Specific Builds
Development Mode
Default mode when runningyarn ios or yarn android:
- Hot reload enabled
- Developer menu accessible
- No optimizations
- Larger bundle size
Release Mode
Run in release mode for performance testing:- ✅ Full optimizations
- ✅ Smaller bundle size
- ✅ Production-like performance
- ❌ No hot reload
- ❌ No developer menu
Use release mode when testing performance or E2E tests. Set
IS_TESTING=true in .env for E2E tests.Multiple Devices
Run on All Android Devices
Run on all connected Android devices:Switch Between Devices
iOS: Select different simulator in Xcode or use--simulator flag.
Android: If multiple devices are connected, specify device:
Troubleshooting
Metro bundler fails to start
Metro bundler fails to start
Clear watchman and Metro cache:
iOS build fails with 'Command PhaseScriptExecution failed'
iOS build fails with 'Command PhaseScriptExecution failed'
Node is not in Xcode’s PATH:
- Close Xcode
- Run
nvm usein terminal - Open Xcode from terminal:
open ios/Rainbow.xcworkspace
Android build fails with 'Cannot run program node'
Android build fails with 'Cannot run program node'
Android Studio doesn’t have
node in PATH:- Close Android Studio
- Launch from terminal:
open -a "Android Studio" - Reopen the
android/folder
App crashes immediately on launch
App crashes immediately on launch
Check Metro bundler is running:View logs:
- iOS: Xcode console or
react-native log-ios - Android: Android Studio logcat or
react-native log-android
Red screen: 'Unable to connect to development server'
Red screen: 'Unable to connect to development server'
iOS: Ensure Metro is running and simulator can reach localhost.Android: Reverse ports:
Hot reload not working
Hot reload not working
- Check Metro is running
- Open developer menu
- Ensure Fast Refresh is enabled
- Try manual reload: Cmd+R (iOS) or R+R (Android)
Clean build and retry
Clean build and retry
If issues persist, clean everything:
Performance Tips
- Use release mode for accurate performance testing
- Disable Remote JS Debugging (it slows down the app significantly)
- Use Flipper or React DevTools instead of Chrome DevTools
- Profile with React DevTools Profiler
- Monitor performance with
yarn shopify:perfif using Shopify performance tools
Next Steps
Building
Create production builds and release packages
Debugging
Debug issues and run E2E tests