How to Fix ‘xcode-select: error: active developer path does not exist’ on Mac

Executing developer commands such as git, brew, npm, or python3 in the macOS Terminal only to be stopped by the alert: xcode-select: error: active developer path (/Applications/Xcode.app/Contents/Developer) does not exist halts software development. This error occurs because macOS relies on the xcode-select utility to route developer tool calls to the active developer directory. When you upgrade macOS, remove a full installation of Xcode, or rely solely on standalone Command Line Tools, the system configuration pointer remains linked to a missing directory path.

Why Does xcode-select Fail to Find the Developer Directory?

The error arises when the global developer directory pointer points to an invalid filesystem path:

  • Uninstalled Full Xcode Application: Deleting /Applications/Xcode.app while keeping standalone Command Line Tools leaves the path pointing to the deleted bundle.
  • Major macOS Upgrades: Upgrades to macOS Sequoia or Sonoma routinely reset or invalidate existing developer shims inside /Library/Developer/CommandLineTools.
  • Multiple Xcode Side-by-Side Installs: Renaming Xcode versions (e.g. Xcode-beta.app) without updating the active pointer.
  • Corrupted Command Line Tools Receipt: Package receipts in the macOS Software Update catalog failing to reflect installed tool packages.

Step 1: Point xcode-select to Standalone Command Line Tools

If you only need Git, Homebrew, and command-line compilers without the full 15GB Xcode application, redirect the path to the native tools bundle.

  1. Open Terminal from Spotlight or Launchpad.
  2. Execute the following command to repoint the developer path:
    sudo xcode-select --switch /Library/Developer/CommandLineTools
  3. Enter your macOS administrator password when prompted and press Enter.
  4. Verify the updated active path:
    xcode-select -p
  5. Test that developer commands run without errors by checking your Git version:
    git --version

Step 2: Install or Reinstall macOS Command Line Tools

If the /Library/Developer/CommandLineTools folder is empty or corrupted, reinstalling the packages restores the missing toolchain.

  1. Remove any damaged Command Line Tools residue by executing:
    sudo rm -rf /Library/Developer/CommandLineTools
  2. Trigger the official Apple software update dialog by running:
    xcode-select --install
  3. A graphical prompt will appear on your desktop asking: ‘The xcode-select command requires the command line developer tools. Would you like to install the tools now?’.
  4. Click Install and accept the Apple Software License Agreement.
  5. Allow macOS to download and unpack the packages. Once finished, run xcode-select -p to confirm registration.

Step 3: Point to Full Xcode (If Installed)

If you intentionally installed Xcode from the Mac App Store, ensure the developer path matches the standard application bundle directory.

  1. Verify that Xcode.app exists in your system Applications folder:
    ls -ld /Applications/Xcode.app
  2. Point xcode-select to the embedded developer directory:
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
  3. Accept the Xcode build licence agreement to unlock the toolchain:
    sudo xcodebuild -license accept

Step 4: Reset the Active Developer Path Shim

If xcode-select continues referencing stale paths despite manual reassignment, reset the configuration to the operating system default.

  1. Execute the reset switch in Terminal:
    sudo xcode-select --reset
  2. Check the developer directory output:
    xcode-select -p
  3. Run brew doctor or your preferred compiler to ensure your local development environment functions smoothly.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.