Error Running React Native App From Terminal (iOS) Error Running React Native App From Terminal (iOS) ios ios

Error Running React Native App From Terminal (iOS)


Check out this link (Running react-native run-ios occurs an error?). It appears to be a problem with the location of Command line tools.

In Xcode, select Xcode menu, then Preferences, then Locations tab. Select your Xcode version from the dropdown and exit Xcode.

XCode location tab


You may need to install or set the location of the Xcode Command Line Tools.

Via command line

If you have Xcode downloaded you can run the following to set the path:

sudo xcode-select -s /Applications/Xcode.app

If the command line tools haven't been installed yet, you may need to run this first:

xcode-select --install

You may need to accept the Xcode license before installing command line tools:

sudo xcodebuild -license accept 

Via Xcode

Or adjust the Command Line Tools setting via Xcode (Xcode > Preferences > Locations):

Xcode preferences - Locations tab


By default, after installing Xcode command-line not selected, so open Xcode and go to Preferences >> Locations and set Command Line Tools...

This worked for me in MAC High Sierra, Xcode Version 9.3:

Xcode Preferences

Press i to open iOS emulator...

Press a to open Android device or emulator, or i to open iOS emulator.

And You can see a cool new iPhone simulator like below image:

React Native prints, I'm Alireza Dezfoolian, a Front End Developer!