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.

macOSxcruncommand-line-toolspathLow risk
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 simctl

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

RiskLow risk
RequirementsCommand Line Tools or Xcode must be installed
!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

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