Development Tools
React DevTools
Inspect React component hierarchy, props, and state:- Start your app (
yarn iosoryarn android) - React DevTools will connect automatically
- Inspect components, view props/state, profile performance
Flipper
Flipper is Facebook’s debugging platform for mobile apps:- Download from https://fbflipper.com/
- Install and launch Flipper
- Run your app (with Flipper support enabled - default)
- App appears in Flipper automatically
- Network Inspector - View all network requests/responses
- React DevTools - Integrated React DevTools
- Logs - View console logs and native logs
- Layout Inspector - Inspect view hierarchy
- Redux Inspector - Debug Redux state (if using Redux)
- Crash Reporter - View crash logs
To build without Flipper (lighter builds):
yarn install-pods-no-flipperMetro Bundler Logs
Metro shows bundling progress and JavaScript errors:Native Logs
iOS Logs
View iOS logs:Android Logs
View Android logs:Debugging Techniques
Console Logging
Basic debugging with console.log:- Metro:
yarn start:client-logs - Flipper: Logs plugin
- Chrome DevTools: When remote debugging
Debugger Statement
Usedebugger to set breakpoints:
React DevTools Profiler
Profile component render performance:- Open React DevTools
- Go to Profiler tab
- Click Record
- Interact with app
- Click Stop
- Analyze component render times
Network Debugging
Flipper Network Inspector
View all network requests in Flipper’s Network plugin.React Native Debugger
Alternative to Chrome DevTools with Network tab:Redux DevTools
For debugging Redux state (Rainbow uses Redux for some legacy features):- Install Redux DevTools Extension
- Use with React Native Debugger or Flipper Redux plugin
End-to-End (E2E) Testing
Rainbow uses Maestro for end-to-end testing.Running E2E Tests
Build in release mode
- iOS
- Android
You can also run in development mode for easier debugging, but it may differ from CI.
E2E Test Structure
Tests are ine2e/flows/ directory:
E2E Test Commands
Maestro uses deep links to speed up test setup:src/components/TestDeeplinkHandler.tsx.
Debugging E2E Tests
Cannot find view with testID on iOS
Cannot find view with testID on iOS
On iOS,
testID uses accessibilityIdentifier. If a parent view has accessible=true, children’s testIDs are hidden.Solution: Move testID to the accessible parent or set accessible=false.Long wait time between actions
Long wait time between actions
Maestro waits for the app to “settle” (no animations). Looping animations prevent settling.Solution: Use
IS_TEST from @/env to disable animations in tests:Flaky tests
Flaky tests
Use Maestro’s retry mechanism:
CI E2E Tests
E2E tests run on CI for every PR. View logs in GitHub Actions artifacts:- Go to Actions run:
https://github.com/rainbow-me/rainbow/actions/runs/<run_id> - Scroll to Artifacts
- Download test logs
Performance Debugging
React Native Performance Monitor
- Open developer menu (Cmd+D on iOS, Cmd+M on Android)
- Enable Show Perf Monitor
- View RAM, JavaScript FPS, UI FPS
Shopify Performance Monitoring
Rainbow uses@shopify/react-native-performance:
package.json for related performance scripts.
Memory Leaks
iOS Memory Profiling
- Open Xcode
- Product → Profile (Cmd+I)
- Select Leaks or Allocations instrument
- Run and interact with app
- Analyze memory usage
Android Memory Profiling
- Open Android Studio
- Run app
- View → Tool Windows → Profiler
- Select app process
- Click Memory timeline
- Analyze memory allocations and GC events
Common Issues & Solutions
Metro bundler connection issues
Metro bundler connection issues
Symptoms: “Unable to connect to development server”Solutions:
White screen on launch
White screen on launch
Symptoms: App shows white screen, no contentSolutions:
- Check Metro bundler is running
- View logs for JavaScript errors
- Try reloading: Cmd+R (iOS) or R+R (Android)
- Check
.envfile is configured - Rebuild app:
yarn iosoryarn android
Native module errors
Native module errors
Symptoms: “Native module X is not available”Solutions:
Slow performance in debug mode
Slow performance in debug mode
Symptoms: App is very slow, animations lagCause: Debug builds are much slower than releaseSolutions:
- Disable remote debugging (very slow)
- Use release mode for performance testing:
yarn ios --mode Release - Use Flipper or React DevTools instead of Chrome DevTools
Build succeeds but app crashes on launch
Build succeeds but app crashes on launch
Symptoms: Build completes but app crashes immediatelySolutions:
- View native crash logs (Xcode console or Android logcat)
- Check for missing environment variables in
.env - Verify native modules are linked correctly
- Check for conflicting dependencies
- Try clean rebuild
Hot reload not working
Hot reload not working
Symptoms: Changes don’t reflect in appSolutions:
- Ensure Metro is running
- Open developer menu, ensure Fast Refresh is enabled
- Try manual reload: Cmd+R (iOS) or R+R (Android)
- Restart Metro:
yarn start --reset-cache - Some changes require full rebuild (native code, new dependencies)
Verification Commands
Run these before committing code:CI Linting
CI runs additional checks:yarn format:check- Prettier formattingyarn lint:ts- TypeScript type checkingyarn lint:js:ci- ESLint (all files, not just changed)yarn lint:js-types- JavaScript type checking against baseline
Debugging Best Practices
- Use TypeScript - Catch errors at compile time
- Write tests - Unit tests catch regressions early
- Use ESLint - Enforce code quality and catch common mistakes
- Check types - Run
yarn lint:tsfrequently - Profile performance - Use React DevTools Profiler for slow components
- Monitor bundle size - Large bundles slow down app startup
- Test on real devices - Simulators/emulators don’t represent real performance
- Use release mode - For accurate performance testing
- Check circular deps - Run
yarn check:cyclesto find circular dependencies - Read error messages - React Native error screens often have helpful stack traces
Additional Resources
Next Steps
Architecture
Understand Rainbow’s architecture and state management
Running the App
Build and run Rainbow in development mode