sudo xcode-select -s /Applications/Xcode.app/Contents/Developer. If it still fails, accept the license with sudo xcodebuild -license.You run a simulator command in Terminal, such as xcrun simctl list, and get this instead:
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
Xcode is installed and the simulators work inside it. Only the command line can’t find simctl. The cause is almost always one setting.
Why this happens
xcrun doesn’t look for tools on your normal PATH. It looks inside the active developer directory, which xcode-select controls. That directory can point to one of two places:
- A full Xcode install, such as
/Applications/Xcode.app/Contents/Developer - The standalone Command Line Tools package at
/Library/Developer/CommandLineTools
The standalone Command Line Tools include compilers, git, make and similar tools. They don’t include the iOS Simulator runtime or simctl. If the developer directory points there, xcrun searches a folder that has no simctl and reports the error above.
This often happens in these cases:
- You installed the Command Line Tools before Xcode. For example, Homebrew or
gitprompted you to install them. - You deleted, renamed or moved Xcode. A beta copy is a common example.
- You switched between several Xcode versions.
- No developer directory was ever set in Xcode’s Locations settings.
A new Xcode install that has never been launched, or whose license you haven’t accepted, can also make xcrun tools fail.
How to fix it
1. Select Xcode as the Command Line Tools in Xcode settings
This is the fix most people need, and you don’t have to type any commands.
- Open Xcode.
- Go to Xcode > Settings (called Preferences in older Xcode versions).
- Open the Locations tab.
- In the Command Line Tools pop-up menu, choose your Xcode version. If the menu is blank, that confirms the problem.
- Enter your admin password if macOS asks for it.
- Open a new Terminal window and test:
xcrun simctl list devices
You should see a list of simulator devices instead of the error.
2. Switch the developer directory with xcode-select
If you prefer Terminal, or you’re setting up a CI machine without a GUI session, first check where the directory points now:
xcode-select -p
If the output is /Library/Developer/CommandLineTools, that’s the cause. Point it at Xcode:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
You can also pass just the app bundle (/Applications/Xcode.app). xcode-select fills in the Contents/Developer part for you. If your Xcode has a different name, such as Xcode-beta.app, use that path.
Check that it worked:
xcode-select -p
xcrun --find simctl
xcrun --find simctl should print a path inside your Xcode bundle.
3. Accept the Xcode license and finish first launch
Your selection may be correct but xcrun tools still fail. An unaccepted license is a common reason, especially after an Xcode update. Accept it from Terminal:
sudo xcodebuild -license
Scroll to the end and type agree. On a script or CI machine, accept without the prompt:
sudo xcodebuild -license accept
If you installed Xcode by unpacking an archive instead of launching it, also run the first-launch setup. It installs the extra components Xcode needs:
sudo xcodebuild -runFirstLaunch
4. Use a specific Xcode for one command with DEVELOPER_DIR
You may have several Xcode versions and not want to change the system-wide setting. Set DEVELOPER_DIR for one command or one shell session:
DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcrun simctl list
This works well in build scripts and CI jobs. Each job can pin its own Xcode without changing what the rest of the machine uses.
5. Check that Xcode is where you think it is
If none of the above helps, confirm the app bundle exists at the path you selected:
ls /Applications | grep -i xcode
If you renamed Xcode, moved it to another folder or volume, or deleted an old copy, the stored path may point to nothing. Select the copy you actually have, using fix 1 or fix 2.
How to prevent it
- After you install, rename or update Xcode, run
xcode-select -pto confirm the developer directory. - Accept the license right after each Xcode update with
sudo xcodebuild -license accept. - On CI machines and in scripts, set
DEVELOPER_DIRor runxcode-select -sat the start of the job. Don’t rely on whatever was set before. - Give side-by-side installs clear names, like
Xcode-beta.app. That makes it obvious which one is selected. - You can keep the standalone Command Line Tools installed if other tools need them. Just don’t leave them selected when you work with simulators.
FAQ
Do I need to uninstall the Command Line Tools package?
No. The standalone tools and Xcode can live side by side. Only the active developer directory matters, and you change it with Xcode’s Locations settings or xcode-select -s.
Why does sudo matter for xcode-select?
The developer directory setting applies to the whole system, so changing it needs admin rights. Reading it with xcode-select -p doesn’t need sudo.
Can I reset xcode-select to its default?
Yes. sudo xcode-select --reset restores the default. That’s usually the Xcode in /Applications if one is installed. Run xcode-select -p afterwards to check where it points, then test with xcrun simctl list.
Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.
