Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 569
JacobSiegel Avatar asked Sep 29 '16 19:09

JacobSiegel


People also ask

How do I run a React Native app in iOS on Mac?

Plug in your device via USB​Connect your iOS device to your Mac using a USB to Lightning cable. Navigate to the ios folder in your project, then open the . xcodeproj file, or if you are using CocoaPods open . xcworkspace , within it using Xcode.

How do I run React Native iOS on iPhone?

Open your react native app's directory, navigate to ios folder, and double-click on . xcworkspace file to open the Xcode. Next, open the Product menu, go to Destination, and select your device. If you don't have an Apple Developer account, you must create one to be able to run your project on an iOS device.


2 Answers

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

like image 199
leo7r Avatar answered Sep 19 '22 23:09

leo7r


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

like image 44
odlp Avatar answered Sep 16 '22 23:09

odlp