sudo xcode-select -s /Applications/Xcode.app to set the correct path, or install tools with xcode-select --install and accept the license with sudo xcodebuild -license accept.Why this happens
The xcrun: error: unable to find utility "instruments" error appears when the Xcode command line tools path isn’t set correctly or the tools aren’t installed. The instruments utility is part of Xcode’s command line toolchain and is required for building and running iOS apps from the terminal.
When you run react-native run-ios or any xcrun command from Terminal, macOS looks for developer utilities in the path defined by xcode-select. If this path points to an invalid location, or if the command line tools package was never installed, xcrun cannot locate instruments and fails. This commonly happens after macOS upgrades, Xcode updates, or when Xcode is installed in a non-standard location.
The error doesn’t appear when building from Xcode’s GUI because the IDE uses its own internal toolchain resolution, bypassing the xcode-select path that Terminal relies on.
How to fix it
1. Set the Xcode command line tools path (most likely fix)
If Xcode is installed in the default /Applications location, point xcode-select to it:
sudo xcode-select -s /Applications/Xcode.app
Enter your administrator password when prompted. This command updates the active developer directory so xcrun can find all utilities including instruments.
Verify the change:
xcode-select -p
# Should output: /Applications/Xcode.app/Contents/Developer
Then test that instruments is accessible:
xcrun instruments -s
2. Install Xcode Command Line Tools if missing
If the tools were never installed or were removed, install them first:
xcode-select --install
A GUI dialog will appear. Click Install and wait for the download to complete. After installation, the path is usually set automatically, but you can confirm with xcode-select -p.
3. Accept the Xcode license agreement
A pending license agreement can block command line tool usage. Accept it with:
sudo xcodebuild -license accept
This is required after a fresh Xcode install or major version upgrade before any xcrun or xcodebuild commands will succeed.
4. Set the path via Xcode GUI (alternative)
If you prefer a graphical approach:
- Open Xcode
- Choose Xcode > Settings (or Preferences on older macOS)
- Select the Locations tab
- In the Command Line Tools dropdown, choose your Xcode version (e.g., “Xcode 27.0”)
- Close the window
This writes the same path that xcode-select -s sets.
How to prevent it
- After every macOS or Xcode update, verify the command line tools path with
xcode-select -p - Keep Xcode in the default
/Applications/Xcode.applocation; avoid renaming or moving the app bundle - Run
sudo xcodebuild -license acceptimmediately after installing or updating Xcode - If you use multiple Xcode versions (e.g., beta and release), switch the active version with
xcode-select -sbefore terminal builds - Add a quick verification step to your CI/CD scripts:
xcrun --show-sdk-pathshould succeed without errors
FAQ
Why does the app build in Xcode but fail with react-native run-ios?
Xcode’s GUI uses its bundled toolchain directly, while react-native run-ios invokes xcrun from Terminal, which depends on the system-wide xcode-select path. If that path is wrong, only command-line builds fail.
What if xcode-select -p shows a path but instruments still isn’t found?
The Xcode installation at that path may be incomplete or corrupted. Reinstall Xcode from the Mac App Store or Apple Developer portal, then re-run sudo xcode-select -s /Applications/Xcode.app.
Can I use this fix for other xcrun utility errors like simctl or xcodebuild?
Yes. The same xcode-select path configuration affects all xcrun utilities. Setting the correct developer directory resolves missing simctl, xcodebuild, ibtool, and other toolchain commands.
Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.
