Switch Developer Toolchains with xcode-select

xcode-select decides which Xcode — or standalone Command Line Tools — provide clang, git, and the SDKs.

macOSxcode-selectclangtoolchainLow risk
Run `xcode-select -p` to print the active developer directory; switch with `sudo xcode-select -s /Applications/Xcode.app`.

01Command

Command
$ xcode-select -p

02What 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

RiskLow risk
RequirementsBuilt-in on macOS; switching paths requires sudo.
!Warning: After switching, run `xcodebuild -version` or `clang --version` to confirm the expected toolchain is active.

04Undo

Undo
$ sudo xcode-select -r

05Sources

Last verified: 2026-09-17 · Category: Developer