gkeenley
gkeenley

Reputation: 7348

React Native: Can you force react-native run-ios to use a different installation of XCode?

I have a React Native app, and when I run react-native run-ios, it opens fine in the default emulator. This is with XCode 11.1. I want to use an iPhone 12 pro max emulator, which comes with XCode 12.1. The XCode 11.1 came from the app store, and I was able to get XCode 12.1 only from the apple developer site, so XCode 11.1 and XCode 12.1 are both installed separately on my system.

When I try to Run the app from XCode 12.1, the build fails, so at the moment the only way I can run the app is with react-native run-ios, but this uses simulators from XCode 11.1 and therefore doesn't allow me to use the iPhone 12 pro max.

What I Want To Know: Is there a way I can force react-native run-ios to use XCode 12.1 instead of XCode 11.1? I want to keep both XCode 11.1 and XCode 12.1 on my system, and run the app using react-native run-ios.

Upvotes: 0

Views: 208

Answers (2)

nghiahoang
nghiahoang

Reputation: 568

You could set the desired Xcode using this in the terminal:

sudo xcode-select -s <path/to/>Xcode.app

Upvotes: 0

Ken Lee
Ken Lee

Reputation: 8043

Set in your Xcode preference (command line tool selection)

Xcode -> Preferences -> Locations -> Choose Command Line Tools -> Choose version -> Close Xcode

then

react-native run-ios

Upvotes: 1

Related Questions