Development Cycle Overview
Starting Development
Launch Dev Server
Start the development server with:What Happens When You Start
1
Metro Bundler Starts
Metro bundler launches on port 8081, ready to transform and bundle your JavaScript
2
Dev Server Starts
HTTP server starts to serve:
- App manifest (configuration)
- JavaScript bundles
- Source maps
- Assets (images, fonts)
3
QR Code Displayed
Terminal shows QR code and connection options:
4
Ready for Connections
Devices can now connect via:
- QR code scan
- Direct URL entry
- Automatic launch (simulators)
Fast Refresh
Fast Refresh updates your app instantly when you save files, preserving component state.How Fast Refresh Works
1
File Changes Detected
Watchman detects file modifications
2
Module Transformed
Metro transforms only the changed module
3
Hot Update Sent
Update is sent via WebSocket to connected devices
4
Component Re-renders
React re-renders the component, preserving state
What Gets Preserved
Preserved during Fast Refresh:
- Component state (useState, useReducer)
- Navigation state
- Form inputs
- Scroll position
Example: Fast Refresh in Action
app/index.tsx
<Text> content and save, the change appears instantly without resetting count.
Development Server Features
Interactive Terminal
While the dev server is running, you can:Developer Menu
Access the developer menu:- iOS Simulator: Cmd+D
- Android Emulator: Cmd+M (Mac) or Ctrl+M (Windows/Linux)
- Physical Device: Shake the device
- Terminal: Press
m
- Reload
- Debug Remote JS (legacy)
- Enable Fast Refresh
- Toggle Element Inspector
- Toggle Performance Monitor
- Open React DevTools
Element Inspector
Inspect UI elements in your app:- Open developer menu
- Select “Toggle Element Inspector”
- Tap any element to see its properties
Performance Monitor
Monitor app performance:- Open developer menu
- Select “Toggle Performance Monitor”
- View real-time metrics:
- JS thread FPS
- UI thread FPS
- RAM usage
- Bridge traffic
Metro Bundler
Metro is the JavaScript bundler that powers Expo development.Metro Configuration
Customize Metro inmetro.config.js:
metro.config.js
Metro Commands
Asset Handling
Metro automatically handles: Images:Build Types
Development Builds
Development builds include your exact dependencies and allow for custom native code. When to use:- Need custom native modules
- Using libraries not in Expo Go
- Configuring native project settings
- Testing production-like behavior
Expo Go Builds
Expo Go is a pre-built app with common SDK modules. When to use:- Learning Expo
- Prototyping quickly
- Only using Expo SDK modules
- Sharing demos
- No custom native code
- Limited to included SDK modules
- Some libraries incompatible
What's included in Expo Go?
What's included in Expo Go?
Expo Go includes these SDK modules:
- Camera, Location, Sensors
- FileSystem, SQLite, SecureStore
- Notifications, Updates
- Image Picker, Document Picker
- Video, Audio, AV
- And 40+ more…
Production Builds
Production builds are optimized for app stores.- Code minification
- Dead code elimination
- Asset optimization
- Source map generation
- Bundle splitting
Debugging
React DevTools
Debug React components:- Component tree inspection
- Props and state viewer
- Performance profiling
- Hook debugging
Console Logs
View console output in terminal:- Terminal (where
expo startis running) - React DevTools console
- Browser console (web)
Debugging Native Code
iOS (Xcode):- Open
ios/YourApp.xcworkspacein Xcode - Set breakpoints in Swift/Objective-C code
- Run from Xcode with debugging
- Open
android/folder in Android Studio - Set breakpoints in Kotlin/Java code
- Run with debugger attached
Network Debugging
Inspect network requests:Environment Configuration
Environment Variables
Useexpo-constants for environment-specific config:
app.config.js
Development vs Production
Check environment:Common Workflows
Adding a New Screen
1
Create file in app/ directory
2
Implement screen
app/profile.tsx
3
Navigate to screen
4
Test on device
Fast Refresh automatically shows the new screen
Installing a New Package
1
Install with expo install
2
Import in your code
3
Use the API
4
Rebuild if needed
If the package has native code not in Expo Go:
Testing on Physical Device
1
Connect to same network
Ensure your device and computer are on the same WiFi
2
Start dev server
3
Scan QR code
- iOS: Use Camera app
- Android: Use Expo Go app
4
App loads
Your app opens and connects to the dev server
Can't connect?
Can't connect?
If scanning doesn’t work:
-
Try tunnel mode:
- Check firewall settings
-
Use USB connection:
Then connect via USB debugging
Performance Best Practices
Optimize Re-renders
Optimize Re-renders
Use React.memo and useMemo to prevent unnecessary re-renders:
Lazy Load Screens
Lazy Load Screens
Use dynamic imports for screens:
Optimize Images
Optimize Images
Use optimized image formats and sizes:
Monitor Performance
Monitor Performance
Use React DevTools Profiler:
Troubleshooting
Metro bundler stuck
Metro bundler stuck
Clear cache and restart:
Fast Refresh not working
Fast Refresh not working
- Check for syntax errors
- Ensure file is in
app/orsrc/ - Manually reload: Press
rin terminal
White screen on load
White screen on load
Check for:
- JavaScript errors in terminal
- Missing imports
- Incorrect file paths
- Network connectivity issues
Native module errors
Native module errors
Rebuild the app:
Next Steps
Expo Go
Learn about the Expo Go app
Tutorial
Build a complete app
Build & Deploy
Ship your app to production
SDK Reference
Explore all SDK modules