Home > News Tips

Fix Xcrun: Error: Invalid Active Developer Path on Sequoia/Sonoma

Updated on Tuesday, December 24, 2024

Written by

Jenny Zeng

Approved by

Jessica Shee

English

"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun" is an error you may encounter after running commands related to git, brew, pip, or other utilities needed for software development in Terminal on Mac.

It usually happens after a macOS update, preventing you from finishing development tasks swiftly. In this article, we'll provide the solutions to fix "xcrun: error: invalid active developer path" on macOS Sequoia, Sonoma, Ventura, Monterey, or earlier.

What does 'xcrun: error: invalid active developer path' mean?

The message "xcrun: error: invalid active developer path" shows up when the Xcode Command Line Tools are not properly installed or the path to them is invalid or corrupted due to OS updates. Typically, the xcrun error occurs if you don't agree to the Xcode Command Line Tools licensing agreement after a macOS update.

How to fix xcrun: error: invalid active developer path on Mac?

Now that you know the cause, it's time to get rid of the error "xcrun: error: invalid active developer path."

Fix 1: Install the Command Line Tools from Terminal

Since the xcrun error results from an invalid path to the Command Line Tools, it's a good idea to install or reinstall them so as to correct the path. To do this:

  1. Open Terminal.
  2. Run the following command.xcode-select --install
  3. When a dialog box asks if you want to install the tools, click Install. (This window may be behind other windows; ensure to check for it.)
  4. Then click Accept to accept the license agreement of Xcode.

This command will start to download and install the newest version of the Command Line Tools. After it's complete, the error will stop appearing.

Fix 2: Install Command Line Tools manually

If Terminal tries to install a large number of data or the previous command doesn't work, you can use the alternative way to get Command Line Tools. Instead of running commands, visit Apple's developer site to download the corresponding .dmg package and install it.

Fix 3: Reset the path to the default location

If Terminal still says it's missing xcrun at: /library/developer/commandlinetools/usr/bin/xcrun, use the following commands individually. These commands contain sudo, so you'll be prompted to enter your administrator login password and hit Enter to send it.

sudo xcode-select -reset

This command resets the Xcode Command Line Tools path to the default location.

sudo xcodebuild -license

This command accepts the license agreement for Xcode tools. It opens the agreement and allows you to agree with it.

Is this post helpful? Share it with others!