dev
Start the Metro bundler for development.
The dev command starts the Metro bundler for development. Use this when you want to run the bundler separately from the build process.
Usage
teardown dev [options]Options
| Option | Description | Default |
|---|---|---|
-p, --port <port> | Port to run Metro on | 8081 |
--reset-cache | Reset the Metro cache | false |
--platform <platform> | Platform to target: ios, android, or all | all |
--verbose | Enable verbose logging | false |
Examples
Start Development Server
teardown devCustom Port
teardown dev --port 8082Reset Cache
teardown dev --reset-cacheUseful when you see stale code or bundler issues.
Verbose Output
teardown dev --verboseShows detailed logging including route generation.
Features
Interactive Mode
Metro runs in interactive mode with keyboard shortcuts:
| Key | Action |
|---|---|
r | Reload the app |
d | Open developer menu |
i | Run on iOS |
a | Run on Android |
j | Open debugger |
Route Pre-Generation
If @teardown/navigation-metro is installed, routes are pre-generated before Metro starts:
Generated route types
Starting Metro bundler...Metro Config Check
The CLI checks for metro.config.js and suggests optimizations:
Tip: Add @teardown/metro-config for 36x faster buildsWhen to Use
Use teardown dev when:
- You want to start Metro separately from building
- You're running the app from Xcode or Android Studio directly
- You have Metro running in one terminal while developing
Use teardown run when:
- You want to build and run in one command
- You're starting fresh development
- You want automatic device management
Metro Configuration
With @teardown/metro-config
For optimized builds, use the Teardown Metro config:
// metro.config.js
const { getDefaultConfig } = require("@react-native/metro-config");
const { withTeardown } = require("@teardown/metro-config");
const config = getDefaultConfig(__dirname);
module.exports = withTeardown(config);With Navigation
Add navigation type generation:
// metro.config.js
const { getDefaultConfig } = require("@react-native/metro-config");
const { withTeardown } = require("@teardown/metro-config");
const { withTeardownNavigation } = require("@teardown/navigation-metro");
const config = getDefaultConfig(__dirname);
module.exports = withTeardownNavigation(withTeardown(config));Troubleshooting
Port Already in Use
Port 8081 is already in useUse a different port:
teardown dev --port 8082Or find and kill the existing process:
lsof -i :8081
kill -9 <PID>Stale Bundle
If changes aren't appearing:
teardown dev --reset-cacheNo metro.config.js
No metro.config.js found. Using default React Native config.This is fine for basic usage. For optimizations, create a metro config.
Navigation Types Not Generating
Ensure @teardown/navigation-metro is installed and routes directory exists:
bun add -D @teardown/navigation-metro
mkdir -p src/_routesRelated
- run - Build and run the app
- Navigation - Navigation setup