Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"npx react-native run-ios" is picking non existing simulator

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

like image 557
vikramvi Avatar asked Sep 10 '25 07:09

vikramvi


2 Answers

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"
like image 179
Michael Bahl Avatar answered Sep 13 '25 07:09

Michael Bahl


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

like image 20
Bek Roz Avatar answered Sep 13 '25 05:09

Bek Roz