Skip to content
Latchkey

macOS runner: "xcrun: error: invalid active developer path" in CI

xcrun reads the active developer directory chosen by xcode-select. If that path does not exist, every tool launched through xcrun (clang, git, make) fails with "invalid active developer path".

What this error means

A build or even git fails with "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: ...", usually after an Xcode or CLT change.

xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Common causes

xcode-select points at a removed directory

The active developer path was set to a CommandLineTools or Xcode location that no longer exists on the runner, so xcrun cannot resolve any tool.

Command Line Tools were not installed or were removed

After an OS or Xcode update the CLT bundle can be absent, leaving the path xcode-select references empty.

How to fix it

Point xcode-select at an installed toolchain

  1. List available toolchains and pick an installed Xcode or CLT path.
  2. Set the active developer directory with xcode-select.
  3. Re-run; xcrun now resolves tools from a valid path.
Terminal
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcrun --version

Reset to the default Command Line Tools

When no full Xcode is needed, reset xcode-select to the default CLT location (or reinstall CLT) so xcrun works.

Terminal
sudo xcode-select --reset
xcrun clang --version

How to prevent it

  • Set xcode-select explicitly to the Xcode version your build needs.
  • Verify xcrun --find clang early to catch a bad path fast.
  • Avoid mutating the developer directory without resetting it after.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →