score:984

Accepted answer

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

score:-3

for any such problem:

  1. go to .expo folder
  2. find apk-cache
  3. remove that folder

and you are done..

hope it helps?

score:0

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

score:0

this is how i got the solution,

> rm -rf ~/library/developer/xcode/deriveddata
> sudo rm -rf /library/developer/commandlinetools
> xcode-select --install
> sudo xcodebuild -license accept

xcode > preferences > location > command line tools choose.

score:0

simply go to xcode

click on xcode from the top left menu xcode->preferences-> location-> click comman line option and set xcode version.

score:2

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

score:2

none of these solutions worked for me. these two similar problems offer temporary solutions that worked, it seems the simulator process isn't being shutdown correctly:

killing simulator processes

from https://stackoverflow.com/a/52533391/11279823

  1. quit the simulator & xcode.
  2. opened activity monitor, selected cpu option and search for sim, killing all the process shown as result.
  3. then fired up the terminal and run sudo xcrun simctl erase all. it will delete all content of all simulators. by content if you logged in somewhere password will be gone, all developer apps installed in that simulator will be gone.

opening simulator before starting the package

from https://stackoverflow.com/a/55374768/11279823

open -a simulator; npm start

hopefully a permanent solution is found.

score:2

  1. go to xcode preferences

  2. locate the location tab

  3. set the xcode version in given command line tools

now, it ll successfully work.

score:3

for me, it turns out that there was an ios system update pending asking to restart the computer. restart and let the update finish solved my problem.

score:5

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.

score:8

problem is your xcode version is not set on command line tools, to solve this problem open xcode>menu>preferences> location> here for command line tools select your xcode version, that's it. enter image description here

score:12

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

score:14

in my case the problem was that xcode was not installed.

score:15

an update for anybody (like me) who's run into this in xcode 13 -- the instruments command has been removed.

updating to the latest version of react-native in your package.json file will no longer try to use the instruments command.

score:18

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!

score:151

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


Related Query

More Query from same tag