What's Happening
You ran xcodebuild โ or something that wraps it like CocoaPods, Fastlane, Flutter, or a React Native build โ and got this:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Short version: xcode-select is pointing at Command Line Tools when it should be pointing at the full Xcode app. CLT is a stripped-down package โ maybe 700 MB. It doesn't ship xcodebuild. Xcode does.
Diagnosing the Problem
Check where the active developer directory is pointing right now:
xcode-select -p
If the output is /Library/Developer/CommandLineTools, that's your problem. It should be pointing inside the Xcode bundle โ typically /Applications/Xcode.app/Contents/Developer.
Next, confirm whether Xcode is actually on the machine:
ls /Applications/Xcode.app
No directory? Install Xcode first. Directory exists? You just need to tell xcode-select to use it.
The Fix
Option 1: Xcode Is Already Installed (Most Common Case)
One command does it:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Then accept the Xcode license agreement. Some tools fail silently without it โ this step takes two seconds and saves a lot of head-scratching later:
sudo xcodebuild -license accept
That's it. Skip to Verification below.
Option 2: Xcode Is Not Installed
Install Xcode from the Mac App Store. Budget 20โ40 minutes depending on your connection โ the download is 10โ15 GB. If you need a specific version to match your team's setup, grab it directly from Apple's developer portal instead.
Once it's done:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept
Option 3: Xcode Is Installed at a Non-Standard Path
Renamed the app? Running a stable release alongside a beta? The path will be different. Find what you have:
# List all Xcode installations
ls /Applications/ | grep -i xcode
# Point to the correct one explicitly
sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
Verifying the Fix
Run both of these:
# Should now show the Xcode app path
xcode-select -p
# Expected output: /Applications/Xcode.app/Contents/Developer
# Should print Xcode version cleanly
xcodebuild -version
# Expected output:
# Xcode 16.x
# Build version 16Cxxx
If the original error came through CocoaPods, Fastlane, or Flutter, re-run that tool now. The xcode-select error should be gone.
Why This Keeps Happening
Install order is the usual culprit. Homebrew, git, and a handful of other tools prompt for Command Line Tools on a fresh Mac โ so CLT lands first. When you install the full Xcode app later, macOS does not automatically update the xcode-select pointer. The old CLT path just sits there until you change it manually.
Major macOS upgrades are the other common trigger. Sonoma, Sequoia โ several of them have reset the developer directory back to CLT even when everything was correctly configured before the upgrade.
Lessons Learned
- Every time you install or update Xcode, run
sudo xcode-select -s /Applications/Xcode.app/Contents/Developerright after. Takes five seconds. Saves this whole debugging session. - After a major macOS upgrade, check
xcode-select -pbefore touching any iOS or macOS builds. - Any build failure with a variation of "requires Xcode"? Check
xcode-select -pfirst. Nine times out of ten, it's pointing at CLT. - Flutter, React Native CLI, Fastlane, and CocoaPods all call
xcodebuildinternally. Different tools, same error, same fix.

