Teardown

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

OptionDescriptionDefault
-p, --port <port>Port to run Metro on8081
--reset-cacheReset the Metro cachefalse
--platform <platform>Platform to target: ios, android, or allall
--verboseEnable verbose loggingfalse

Examples

Start Development Server

teardown dev

Custom Port

teardown dev --port 8082

Reset Cache

teardown dev --reset-cache

Useful when you see stale code or bundler issues.

Verbose Output

teardown dev --verbose

Shows detailed logging including route generation.

Features

Interactive Mode

Metro runs in interactive mode with keyboard shortcuts:

KeyAction
rReload the app
dOpen developer menu
iRun on iOS
aRun on Android
jOpen 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 builds

When 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 use

Use a different port:

teardown dev --port 8082

Or find and kill the existing process:

lsof -i :8081
kill -9 <PID>

Stale Bundle

If changes aren't appearing:

teardown dev --reset-cache

No 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.

Ensure @teardown/navigation-metro is installed and routes directory exists:

bun add -D @teardown/navigation-metro
mkdir -p src/_routes