expo run commands compile your native code and launch your app on iOS simulators, Android emulators, or physical devices. These commands are essential for testing native modules and custom native code.
expo run:ios
Build and run the iOS app binary locally.Usage
Options
Device name or UDID to build the app on. Alias:
-dCan be:- Device name (e.g., “iPhone 15 Pro”)
- Device UDID for physical devices
- Boolean flag to select from available devices
Xcode scheme to build. If not specified, the first scheme in the workspace is used.
Xcode configuration to use. Options:
Debug or Release. Default: DebugClear the native derived data before building. Use this when you encounter build issues.
Skip installing npm dependencies before building.
Skip starting the Metro bundler. Use this if Metro is already running.
Port to start the Metro bundler on. Default: 8081. Alias:
-pPath to existing
.app or .ipa file to install instead of building.Examples
Basic iOS Build
Build and run on default simulator:Specific Device
Run on a specific simulator:Production Build
Build with Release configuration (unsigned):Clean Build
Clear derived data for a fresh build:Custom Scheme
Build a specific scheme:Without Metro
If Metro is already running:Platform Requirements
- macOS only - iOS development is not supported on Windows or Linux
- Xcode - Install from the Mac App Store
- iOS Simulator - Included with Xcode
- CocoaPods - Installed automatically if not present
How It Works
- Runs prebuild - Generates native iOS project if needed
- Installs CocoaPods - Runs
pod installin the ios directory - Resolves device - Selects or launches simulator
- Builds with Xcode - Compiles native code using
xcodebuild - Installs app - Deploys to simulator or device
- Starts Metro - Launches bundler for JavaScript
- Opens app - Launches the app on the device
expo run:android
Build and run the Android app binary locally.Usage
Options
Device name to run the app on. Alias:
-dCan be:- Device name or ID from
adb devices - Boolean flag to select from available devices
Build variant or product flavor and build variant. Default:
debugExamples:debug- Debug buildrelease- Release buildproductionDebug- Product flavor with debug build type
Clear the native build cache before building.
Skip installing npm dependencies before building.
Skip starting the Metro bundler.
Port to start the dev server on. Default: 8081. Alias:
-pPath to existing
.apk or .aab file to install instead of building.Custom Android application ID to launch. Overrides the default package name.
Examples
Basic Android Build
Build and run on default device/emulator:Specific Device
Run on a specific device:Production Build
Build with release variant:android/app/build.gradle.
Clean Build
Clear build cache:Custom App ID
Launch a specific application ID:Install Existing APK
Install a pre-built APK:Platform Requirements
- Java Development Kit (JDK) - Version 17 or newer
- Android Studio or Android SDK
- Android emulator or physical device with USB debugging enabled
How It Works
- Runs prebuild - Generates native Android project if needed
- Resolves device - Selects device or launches emulator
- Configures Gradle - Sets up build properties
- Builds with Gradle - Compiles native code
- Installs APK - Deploys to device via ADB
- Starts Metro - Launches bundler for JavaScript
- Opens app - Launches the app on the device
Common Use Cases
Development Workflow
Useexpo run commands when you need to:
- Test native modules and APIs
- Debug platform-specific code
- Verify native build configuration
- Test on physical devices
- Profile app performance
- Test production builds locally
When Not to Use
For JavaScript-only changes, useexpo start instead:
Device Selection
iOS Devices
List available iOS simulators:Android Devices
List connected Android devices:Troubleshooting
iOS Build Failures
Clear derived data:Android Build Failures
Clean Gradle cache:Code Signing (iOS)
For physical devices, you need a development certificate:- Open
ios/*.xcworkspacein Xcode - Select your team in Signing & Capabilities
- Connect your device
- Trust the certificate on your device
ADB Connection Issues (Android)
Restart ADB server:- Go to Settings → About Phone
- Tap Build Number 7 times
- Go to Developer Options
- Enable USB Debugging
Comparing with expo start
| Feature | expo start | expo run |
|---|---|---|
| Native builds | Uses existing binary | Compiles native code |
| Speed | Fast | Slower (compile time) |
| Use case | JS development | Native development |
| Requirements | Expo Go or dev build | Xcode/Android Studio |
| Native changes | Not reflected | Reflected |
expo run when working with native code, expo start for everything else.