18

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

vikramvi
  • 3,312
  • 10
  • 45
  • 68

6 Answers6

40

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"
Anentropic
  • 32,188
  • 12
  • 99
  • 147
Michael Bahl
  • 2,941
  • 1
  • 13
  • 16
12

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

Bek Roz
  • 658
  • 7
  • 10
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.

André Herculano
  • 1,258
  • 20
  • 33
1

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
Sha
  • 21
  • 2
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

-3

You can open Xcode select ios folder. Choose the simulator here enter image description here