Home/Troubleshooting/git asks to install the command line developer tools, or xcrun: error: invalid active developer path

git asks to install the command line developer tools, or xcrun: error: invalid active developer path

Updated · airankrush

Symptom

Running git, make, clang or python3 in Terminal brings up a dialog saying the command requires the command line developer tools and asking whether to install them. Or Terminal prints xcrun: error: invalid active developer path.

Possible causes (most common first)

  1. The command line developer tools have never been installed on this Mac. Apple's documentation says that on a fresh macOS install, the first call to a command such as git makes the system offer to download and install them.
  2. After a macOS upgrade, the previously installed tools package is not compatible with the new system and needs to be reinstalled or updated.
  3. The currently selected developer directory points to an Xcode that has been deleted or moved.

Troubleshooting steps (easiest first)

  1. Run the install command, then click Install on the remote desktop

    Run xcode-select --install in Terminal. The command only starts the request; the actual install dialog appears in the graphical interface. You need to see it through the remote desktop, click Install, accept the licence agreement and click Done when it finishes. If a tool such as Claude Code is running the command in a terminal on your behalf, it cannot see or click that window and the command seems to do nothing. Connect to the desktop and click it yourself. Steps are in the Apple developer documentation.

  2. Verify the installation

    xcode-select -p prints the current developer directory; the standalone tools package lives at /Library/Developer/CommandLineTools. Then confirm that git --version and clang --version produce normal output. To find out which version is installed, Apple's documentation gives pkgutil --pkg-info=com.apple.pkg.CLTools_Executables.

  3. If the dialog's download fails, use the installer package

    If the download in the dialog fails repeatedly, sign in to the downloads page on the Apple Developer website, search for Command Line Tools, and download and install the version that matches your current macOS by hand. Only one version of the tools package can be installed on a Mac at a time.

  4. If full Xcode is installed

    With Xcode installed you do not need this package separately; Xcode ships the same tools. Commands such as xcodebuild, however, come only with full Xcode and are not in the standalone package. If the path printed by xcode-select -p no longer exists, point it at Xcode again with xcode-select -s followed by Xcode's path. That command has to be run as an administrator; enter this Mac's login password when asked.

  5. Keep it updated, but do not upgrade macOS along the way

    New versions of the tools package appear in System Settings → General → Software Update. You can update just the Command Line Tools item. Do not click the macOS upgrade on the same page at the same time; contact support before upgrading the system.

When to contact support directly

If both the install dialog and the manual package fail, or you still get invalid active developer path after installing, contact support on Contact support. Include your machine ID, macOS version, the output of xcode-select -p and the exact error text. If you see no dialog at all on the remote desktop and suspect the window is hidden, also say which remote connection method you are using.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All troubleshooting pages