Locate developer tools with xcrun --find
xcrun is the dispatcher for Apple's developer tools, and --find prints where any of them actually lives, which changes depending on which Xcode or CLT is selected.
Run `xcrun --find clang` to print the absolute path of the selected toolchain's clang, or use `xcrun clang` to run it directly.
01Command
Command
$ xcrun --find clang
xcrun --find swift
xcrun --find simctl02What it does
Tools like swift, simctl, and instrument helpers are not always on PATH and move when you switch toolchains with xcode-select, so scripts that hardcode paths break. `xcrun --find` resolves the active SDK and developer directory and prints the resolved binary, while invoking via `xcrun <tool>` guarantees the tool matches the selected toolchain.
03Risk
!Warning: If no Command Line Tools or Xcode are selected, xcrun fails with a license or 'unable to find utility' error; fix with xcode-select.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- xcrun — run or locate developer tools (macOS)Evidence: Documents --find to print the path of the named developer tool.
- Installing the Command Line ToolsEvidence: Apple documents the Command Line Tools that xcrun resolves against.
Last verified: 2026-09-17 · Category: Developer