Switch Developer Toolchains with xcode-select
xcode-select decides which Xcode — or standalone Command Line Tools — provide clang, git, and the SDKs.
Run `xcode-select -p` to print the active developer directory; switch with `sudo xcode-select -s /Applications/Xcode.app`.
01Command
Command
$ xcode-select -p02What it does
xcode-select manages a single symlink (/Library/Developer/CommandLineTools or an Xcode.app) that every developer tool consults. -p shows the current target, -s switches it (requires sudo), and -r resets to the system default. Mismatches are the classic cause of errors like 'unable to find utility' or wrong-SDK builds after a Xcode version change. xcrun respects the same setting, so one switch fixes all tools at once.
03Risk
!Warning: After switching, run `xcodebuild -version` or `clang --version` to confirm the expected toolchain is active.
04Undo
Undo
$ sudo xcode-select -r05Sources
- xcode-select — manage the active developer directory (macOS)Evidence: Documents -p to print the active path, -s to switch it, and -r to reset to the default toolchain.
Last verified: 2026-09-17 · Category: Developer