React Native Change Default iOS Simulator Device
Solution 1:
Specify a simulator using the --simulator
flag.
These are the available devices for iOS 14.0 onwards:
npx react-native run-ios --simulator="iPhone 8"
npx react-native run-ios --simulator="iPhone 8 Plus"
npx react-native run-ios --simulator="iPhone 11"
npx react-native run-ios --simulator="iPhone 11 Pro"
npx react-native run-ios --simulator="iPhone 11 Pro Max"
npx react-native run-ios --simulator="iPhone SE (2nd generation)"
npx react-native run-ios --simulator="iPhone 12 mini"
npx react-native run-ios --simulator="iPhone 12"
npx react-native run-ios --simulator="iPhone 12 Pro"
npx react-native run-ios --simulator="iPhone 12 Pro Max"
npx react-native run-ios --simulator="iPhone 13 Pro"
npx react-native run-ios --simulator="iPhone 13 Pro Max"
npx react-native run-ios --simulator="iPhone 13 mini"
npx react-native run-ios --simulator="iPhone 13"
npx react-native run-ios --simulator="iPod touch (7th generation)"
npx react-native run-ios --simulator="iPad Pro (9.7-inch)"
npx react-native run-ios --simulator="iPad (9th generation)"
npx react-native run-ios --simulator="iPad Air (4th generation)"
npx react-native run-ios --simulator="iPad Pro (11-inch) (3rd generation)"
npx react-native run-ios --simulator="iPad Pro (12.9-inch) (5th generation)"
npx react-native run-ios --simulator="iPad mini (6th generation)"
List all available iOS devices:
xcrun simctl list devices
There is currently no way to set a default.
React Native Docs: Running On Simulator
Solution 2:
You can also use npm for this by adding an entry to the scripts
element of your package.json
file. E.g.
"launch-ios": "react-native run-ios --simulator \"iPad Air 2\""
Then to use this: npm run launch-ios