[javascript] Error Running React Native App From Terminal (iOS)

I am following the tutorial on the official React Native website.

Using the following to build my project:

react-native run-ios

I get the error:

Found Xcode project TestProject.xcodeproj
xcrun: error: unable to find utility "instruments", not a developer   
tool or in PATH

Command failed: xcrun instruments -s
xcrun: error: unable to find utility "instruments", not a developer 
tool or in PATH

Although, when I run the app from the .xcodeproj, everything works fine.

Any suggestions?

This question is related to javascript ios reactjs react-native ios-simulator

The answer is


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


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


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!


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.


For any such problem:

  1. Go to .expo folder
  2. Find apk-cache
  3. Remove that folder

and you are done..

Hope it helps?


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 my case the problem was that Xcode was not installed.


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 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.


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.


Examples related to javascript

need to add a class to an element How to make a variable accessible outside a function? Hide Signs that Meteor.js was Used How to create a showdown.js markdown extension Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Summing radio input values How to execute an action before close metro app WinJS javascript, for loop defines a dynamic variable name Getting all files in directory with ajax

Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to reactjs

Error: Node Sass version 5.0.0 is incompatible with ^4.0.0 TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined raised when starting react app Template not provided using create-react-app How to resolve the error on 'react-native start' Element implicitly has an 'any' type because expression of type 'string' can't be used to index Invalid hook call. Hooks can only be called inside of the body of a function component How to style components using makeStyles and still have lifecycle methods in Material UI? React Hook "useState" is called in function "app" which is neither a React function component or a custom React Hook function How to fix missing dependency warning when using useEffect React Hook? Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release

Examples related to react-native

How to resolve the error on 'react-native start' React Native Error: ENOSPC: System limit for number of file watchers reached How to update core-js to core-js@3 dependency? Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 How can I force component to re-render with hooks in React? What is useState() in React? Getting all documents from one collection in Firestore ReactJS: Maximum update depth exceeded error React Native: JAVA_HOME is not set and no 'java' command could be found in your PATH

Examples related to ios-simulator

The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 flutter run: No connected devices Error Running React Native App From Terminal (iOS) How to uninstall downloaded Xcode simulator? Capture iOS Simulator video for App Preview iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development How to enable native resolution for apps on iPhone 6 and 6 Plus? How to access iOS simulator camera Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." Document directory path of Xcode Device Simulator