run-ios command builds your iOS app and runs it on a simulator or connected device.
Usage
This command is only available on macOS with Xcode installed.
Options
| Option | Description | Default |
|---|---|---|
--simulator <string> | Simulator name to launch | iPhone 15 |
--device <string> | Run on a connected device by name | None |
--udid <string> | Run on device with specific UDID | None |
--scheme <string> | Xcode scheme to build | App name |
--configuration <string> | Build configuration | Debug |
--mode <string> | Build mode (Debug/Release) | Debug |
--port <number> | Metro bundler port | 8081 |
--terminal <string> | Terminal app to launch Metro | Default |
--no-packager | Don’t start Metro bundler | false |
--verbose | Show verbose build output | false |
--xcconfig <path> | Custom xcconfig file | None |
--buildFolder <path> | Custom build folder | ios/build |
--interactive | Run in interactive mode | false |
Examples
Basic Usage
Specific Simulator
iPad Simulator
Specific iOS Version
Physical Device
Release Build
Custom Scheme
Custom Metro Port
Without Packager
Verbose Output
Build Configurations
Debug (Default)
- Developer menu enabled
- Fast Refresh enabled
- Connects to Metro bundler
- Not optimized
Release
- Optimized build
- JavaScript bundled in app
- No developer tools
- Requires signing
Common Workflows
First Time Setup
Running on Physical Device
Configure signing
- Select your project in the navigator
- Select your target
- Go to Signing & Capabilities
- Select your Team
- Ensure Automatically manage signing is checked
Using Multiple Schemes
If you have multiple schemes (e.g., Development, Staging, Production):Device Selection
List Available Simulators
List Connected Devices
Run on Specific UDID
Environment Variables
Custom Port
Skip Pod Install
Troubleshooting
Command Not Found
Error:Command 'run-ios' not found
Solution:
Ensure you’re in a React Native project directory and have installed dependencies:
Xcode Not Found
Error:xcodebuild: error: SDK "iphoneos" cannot be located
Solution:
CocoaPods Not Installed
Error:CocoaPods is not installed
Solution:
Simulator Won’t Launch
Error: Simulator specified not found Solution:Build Failed
Error: Various build errors Solution:Cannot Connect to Metro
Error: Red screen “Could not connect to development server” Solution:Signing Errors
Error:Code signing is required
Solution:
- Open
ios/YourApp.xcworkspacein Xcode - Select your target
- Go to Signing & Capabilities
- Select your development team
- Let Xcode automatically manage signing
Module Not Found
Error:Unable to resolve module
Solution:
Xcode Configuration
Custom Build Settings
Editios/YourApp.xcconfig:
ios/YourApp.xcconfig
Multiple Configurations
In Xcode:- Select project > Info tab
- Under Configurations, duplicate Debug or Release
- Rename to your configuration (e.g., “Staging”)
- Run with:
Performance Tips
Faster Builds
Faster Builds
Enable Xcode’s new build system in Xcode preferences.Also consider:
Reduce App Size
Reduce App Size
Use Release configuration which includes optimizations:
Parallel Builds
Parallel Builds
Add to your Xcode build settings:
Advanced Usage
Custom Build Folder
Interactive Mode
Custom Terminal for Metro
Next Steps
Build iOS
Build IPA for TestFlight or App Store
iOS Logs
View device logs for debugging
Running on Device
Complete guide for physical devices
iOS Setup
Configure iOS development environment