Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

xcode-select says there is no active developer directory

Errorxcode-select: error: Unable to get active developer directory. Use sudo `xcode-select --switch <path/to/>Xcode.app` to set one (or use the `man xcode-select` command)

Short answer

macOS keeps one active developer directory that points at Xcode or the Command Line Tools package. The error means that pointer is empty, stale, or set to the tools package when a command needs the full Xcode app. Print the path, then install the tools or switch the pointer with xcode-select.

  • Applies to Xcode 26, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the active developer directory and see what is installed. The output tells you which of the causes below you have.

    xcode-select --print-path
    ls /Applications | grep -i xcode
    ls /Library/Developer/CommandLineTools
  2. 2Match what you see, then jump to its fix

    1. 1--print-path itself prints the Unable to get active developer directory error, and neither folder existsNo Xcode or Command Line Tools is installed or selectedFix
    2. 2--print-path fails or prints an old path, while Xcode exists in /Applications or another folderXcode is installed but not selected, or it lives in a non-standard folderFix
    3. 3--print-path shows /Library/Developer/CommandLineTools, and a tool such as xcodebuild or xctrace failsThe Command Line Tools package is selected, but the command only ships with XcodeFix
    4. 4Builds or git started failing right after a macOS update, and the Command Line Tools package version is older than the systemThe tools package is out of date after a macOS upgradeFix

What does the error look like?

  • xcode-select: error: Unable to get active developer directory. Use sudo `xcode-select --switch <path/to/>Xcode.app` to set one (or use the `man xcode-select` command)

Cause 1 of 4

No Xcode or Command Line Tools is installed or selected

1Check

A fresh macOS has no developer directory. Running a tool such as git normally offers the install by itself.

xcode-select --print-path
ls /Library/Developer/CommandLineTools

2Fix

Install the Command Line Tools package, then click Install in the dialog and accept the licence.

xcode-select --install

3Verify

The path is printed and no error shows.

xcode-select --print-path

Confirmed by developer.apple.com

Did this fix it?

Cause 2 of 4

Xcode is installed but not selected, or it lives in a non-standard folder

1Check

The standard location is /Applications/Xcode.app. If you moved or renamed it, for example to /Applications/Xcode26/Xcode.app, you must select that location yourself.

xcode-select --print-path
ls -d /Applications/Xcode*.app

2Fix

Point the active developer directory at the Xcode app you want. This needs administrator rights.

sudo xcode-select --switch /Applications/Xcode.app

3Verify

The path now ends in Contents/Developer inside that Xcode app.

xcode-select --print-path

Confirmed by developer.apple.com

Did this fix it?

Cause 3 of 4

The Command Line Tools package is selected, but the command only ships with Xcode

1Check

xcodebuild and xctrace are not in the Command Line Tools package. They need the full Xcode app to be the active developer directory.

xcode-select --print-path
ls /Applications/Xcode.app

2Fix

Install Xcode, then switch to it. To try another Xcode for one command only, set DEVELOPER_DIR for that command and leave the global setting alone.

sudo xcode-select --switch /Applications/Xcode.app
env DEVELOPER_DIR="/Applications/Xcode-beta.app" xcodebuild -version

3Verify

xcodebuild reports the Xcode version you chose.

xcodebuild -version

Confirmed by developer.apple.com

Did this fix it?

Cause 4 of 4

The tools package is out of date after a macOS upgrade

1Check

Apple warns that after a macOS upgrade the installed package may be incompatible. Check its version and look for updates.

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
# System Settings > General > Software Update

2Fix

Install the update for your macOS from Software Update in System Settings, or with softwareupdate.

# System Settings > General > Software Update > install the Command Line Tools update

3Verify

pkgutil reports the new version after the update is installed.

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

Confirmed by developer.apple.com

Did this fix it?

How do I stop it coming back?

  • Keep Xcode at /Applications/Xcode.app, or run xcode-select --switch whenever you move it.
  • After each macOS upgrade, check Software Update for a new Command Line Tools release.
  • Use DEVELOPER_DIR to try a beta Xcode for one command instead of switching the system setting.
  • In CI scripts, print xcode-select --print-path at the start so a wrong selection is visible in the log.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.