I am following the tutorial on the official React Native website.
Using the following to build my project:
react-native run-ios
I g
In my case the SDKROOT environment variable was wrong, which referred to an old version of iPhoneOSxx.x.sdk. (Perhaps this would have automatically resolved itself after a reboot?)
You can check by running echo $SDKROOT
and verifying that it's a valid path.
I fixed it by updating in .bash_profile:
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk
For those like me who come to this page with this problem after updating Xcode but don't have an issue with the location setting, restarting my computer did the trick.
I had to accept the XCode license after my first install before I could run it. You can run the following to get the license prompt via command line. You have to type agree
and confirm as well.
sudo xcodebuild -license
1) Go to Xcode Preferences
2) Locate the location tab
3) Set the Xcode verdion in Given Command Line Tools
Now, it ll successfully work.
In Mac: After all, you are getting this issue, there may be a chance of missing the following in System Preferences -> Network -> Ethernet -> Select Advanced -> Proxies
add the following line,
*.local,localhost
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:
Press i
to open iOS emulator...
And You can see a cool new iPhone simulator like below image: