23

As per https://reactnative.dev/docs/environment-setup, I'm trying to run sample project on iOS simulator

When I ran command npx react-native run-ios getting error

info Found Xcode workspace "AwesomeProject.xcworkspace"
error No simulator available with name "iPhone 12".

From where does it picking iPhone 12, I don't have that simulator in first place

0

6 Answers 6

49

Open Xcode and check which simulators are installed or list available simulators in terminal with xcrun simctl list devices.

Then define a simulator you wanna use:

npx react-native run-ios --simulator="iPhone 13"
6
  • I know this step but it didn't answer from where does it pick up "iPhone12" , that simulator is not even present
    – vikramvi
    Commented Aug 26, 2021 at 10:19
  • Your projects xcode file and check which simulator is selected Commented Aug 26, 2021 at 12:49
  • 1
    The argument is with a double dash --simulator='iPhone 13'. At least thats what worked for me.
    – Jason
    Commented Jul 7, 2022 at 21:52
  • 1
    how do you get the iphone 13 sim? Commented Sep 23, 2022 at 12:11
  • @SuperUberDuper Install the simulator with Xcode first.
    – StoneLam
    Commented Dec 2, 2022 at 5:03
15

If you're coming from React Native, follow these:

  1. Accept XCode licence aggreement:
sudo xcodebuild -license
  1. Run simulator using iPhone 14, if you haven't added old iPhones:
npx react-native run-ios --simulator="iPhone 14"
  1. Make sure you have chosen command line tools on XCode:

Xcode => Preferences => Locations

Location Tab

8

React Native will pick a particular device by default, depending on its version. As of version 0.67.2, for example, it'll try to boot an iPhone 13 by default regardless of it existing locally or not.

0

I had a similar error and I fixed it by creating a new simulator with this exact name (case sensitive) Open Simulator App > File > New Simulator > create one with the name from the error

0

I was facing the same problem. Then i just run

sudo npx expo start

Resolve the incompatible dependencies it will show you.

Press " i " to run the app. The app will open on a booted simulator.

See available with :

xcrun simctl list devices
1
  • OP did not specify if they're using expo. Commented Mar 30 at 12:47
0

Now you need to run the app like this with double dashes two times:

For simulator:

 npm run ios -- --simulator="iPhone SE (3rd generation)"

For real device:

 npm run ios -- --device="your iPhone name here"

Not the answer you're looking for? Browse other questions tagged or ask your own question.