The problem is that Xcode Command-line Tools needs to be updated.
** UPDATED for Ventura and updated apple dev download page **
After opening the terminal after a restart, I tried to go to my code, and do a git status, and I got an error and prompt for command line software agreement.
So press space until you get to the [agree, print, cancel] option, so careful hit space to scroll down to the end, if you blow past It you have to run a command to get it back. Use sudo xcodebuild -license to get to it again.
Just be careful on scrolling down and enter agree and press return and it will launch into an update.
Then I tried to use git after the install, and it prompted me to install Xcode tools again.
I followed my own advice from previous years (see below), and went to https://developer.apple.com/download/all/?q=Command%20Line%20Tools and downloaded
«Command Line Tools for Xcode 14» (You have to log in with your Apple ID, so have that login readily available.
You have to either download the tools from CLI or the developer page and before you can use git, you need to reboot!!! SUPER IMPORTANT, you can get stuck in a loop of downloading
Rebooting will break the loop and complete the installation of your CLI tools including git so that you can get back to work
Solutions for previous years, these may or may not be valid these days as the downloads page has changed significantly:
PREVIOUS YEARS SOLUTIONS, probably #2 is most helpful.
** Solution #1 **
Go back to your terminal and enter:
xcode-select --install
You’ll then receive the following output:
xcode-select: note: install requested for command line developer tools
You will then be prompted in a window to update Xcode Command Line tools. (which may take a while)
Open a new terminal window and your development tools should be returned.
Addition: With any major or semi-major update you’ll need to update the command line tools in order to get them functioning properly again. Check Xcode with any update. This goes beyond Mojave…
After that restart your terminal
Alternatively, IF that fails, and it very well might…. you’ll get a pop-up box saying «Software not found on server», see below!
Solution #2
and you hit xcode-select --install and it doesn’t find the software, log into Apple Developer, and install it via webpage.
Log in or sign up here:
https://developer.apple.com/download/more/
Look for: «Command Line Tools for Xcode 14.x» in the list of downloads
Then click the dmg and download.
The problem is that Xcode Command-line Tools needs to be updated.
** UPDATED for Ventura and updated apple dev download page **
After opening the terminal after a restart, I tried to go to my code, and do a git status, and I got an error and prompt for command line software agreement.
So press space until you get to the [agree, print, cancel] option, so careful hit space to scroll down to the end, if you blow past It you have to run a command to get it back. Use sudo xcodebuild -license to get to it again.
Just be careful on scrolling down and enter agree and press return and it will launch into an update.
Then I tried to use git after the install, and it prompted me to install Xcode tools again.
I followed my own advice from previous years (see below), and went to https://developer.apple.com/download/all/?q=Command%20Line%20Tools and downloaded
«Command Line Tools for Xcode 14» (You have to log in with your Apple ID, so have that login readily available.
You have to either download the tools from CLI or the developer page and before you can use git, you need to reboot!!! SUPER IMPORTANT, you can get stuck in a loop of downloading
Rebooting will break the loop and complete the installation of your CLI tools including git so that you can get back to work
Solutions for previous years, these may or may not be valid these days as the downloads page has changed significantly:
PREVIOUS YEARS SOLUTIONS, probably #2 is most helpful.
** Solution #1 **
Go back to your terminal and enter:
xcode-select --install
You’ll then receive the following output:
xcode-select: note: install requested for command line developer tools
You will then be prompted in a window to update Xcode Command Line tools. (which may take a while)
Open a new terminal window and your development tools should be returned.
Addition: With any major or semi-major update you’ll need to update the command line tools in order to get them functioning properly again. Check Xcode with any update. This goes beyond Mojave…
After that restart your terminal
Alternatively, IF that fails, and it very well might…. you’ll get a pop-up box saying «Software not found on server», see below!
Solution #2
and you hit xcode-select --install and it doesn’t find the software, log into Apple Developer, and install it via webpage.
Log in or sign up here:
https://developer.apple.com/download/more/
Look for: «Command Line Tools for Xcode 14.x» in the list of downloads
Then click the dmg and download.
Недавно, при попытке использовать команду git commit в приложении Terminal, Я увидела сообщение об ошибке — xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun. В этой статье вы узнаете, как исправить ошибку, которая приводит к этому сообщению об ошибке. Давайте начнём.
Что вызывает эту ошибку
В моём случае указанная ниже ошибка появилась при попытке запустить команду git commit в приложении Terminal на моём MacBook Pro с macOS Big Sur (Версия 11.2).
$ git commit -m "New commit" xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Сообщение об ошибке выше не требует пояснений. В нём говорится о том, что активный путь разработчика (/Library/Developer/CommandLineTools) недействителен. Следовательно, ошибка связана не с самим git а с инструментами командной строки (Command Line Tools).
Я уверена, что на моём Mac установлены инструменты командной строки; Я уже использовала эти инструменты и раньше всё было хорошо. В моём случае эта ошибка появилась после обновления macOS до версии 11.2 под названием “Big Sur”. Поэтому Я подумала, что, возможно, мне просто нужно переустановить инструменты командной строки “Command Line Tools” на моём Mac, чтобы решить проблему с путями в моей установке “Command Line Tools”.
Теперь мы знаем, что вызвало эту ошибку.
Как это решить
Как только мы узнаём, что вызывает появление этого сообщения об ошибке, мы можем использовать это для решения проблемы. Это действительно простой процесс. Чтобы решить эту проблему, нам необходимо установить (или переустановить, если они уже установлены) инструменты командной строки (Command Line Tools). Теперь пошаговое руководство.
Запустите приложение терминала. В качестве терминального приложения Я использую Terminal, но вы можете использовать любое другое терминальное приложение.
Для пользователей macOS: Приложение Terminal можно найти в папке Utilities вашей папки Applications, или воспользуйтесь Spotlight чтобы найти его.
В терминале введите следующую команду и нажмите клавишу Enter чтобы установить Command Line Tools.
Вы должны получить следующий вывод:
xcode-select: note: install requested for command line developer tools
Кликните на кнопку Install (Установить).
Согласитесь с “License Agreement” (Лицензионное соглашение) нажав кнопку Agree(Согласен).
Пусть установка сделает свою работу, не прерывайте её. Это может занять некоторое время, так что наберитесь терпения. В моём случае это заняло несколько минут.
Теперь перезапустите терминальное приложение. Мне не пришлось перезапускать терминальное приложение. Но Я знаю, что в некоторых случаях без перезагрузки не работает.
Наконец, вы можете повторно ввести команду, которую вы использовали, когда увидели сообщение об ошибке, чтобы убедиться, что она работает без ошибок. (в моём случае команда была git commit)
git commit -m "New commit"
[master 1ddfda0] New commit Date: Sun Feb 14 22:00:27 2021 +0300 2 files changed, 8 insertions(+), 2 deletions(-)
Ошибок нет. Это работает!
Вывод
Ну вот и всё, мы это сделали! Теперь ошибка xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun должна исчезнуть. Так просто, не правда ли?
Если у вас возникли проблемы с решением этой проблемы с помощью приведённых выше инструкций, но вы можете решить эту проблему с помощью любого другого метода, опишите его в разделе комментариев ниже. Спасибо!
Я надеюсь, что эта статья помогла вам узнать, как исправить ошибку xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun. Если эта статья помогла вам, пожалуйста, оставьте комментарий
Спасибо за прочтение!
Xcrun error invalid active developer path causing trouble? We have your back.
At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.
Let’s take a look at how our Support Team recently helped out a customer with the xcrun error: invalid active developer path
How to resolve Xcrun error invalid active developer path
Some of our customers have been running into the following error when they attempt to run an update on macOS while running a git pull command:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
According to our Support Techs, we can resolve the issue by installing or updating Xcode Command-line Tools and explicitly agreeing to the license agreement.
In fact, if we have Xcode installed we can go opt to resolve the issue:
-
- Via command line
- Via Apple Developer download page
How to resolve the xcrun error via command line
- First, we will open the terminal and run the following command to install Xcode:
xcode-select ––install
- Next, we will get the following output:
xcode-select: note: install requested for command line developer tools.
- After the installation is over we can test the git commands through a new terminal.
In case the problem continues, we can go ahead with a reset with this command:
sudo xcode-select --reset
How to resolve the xcrun error Via Apple Developer download page
If the xcode-select –install cannot locate the software, we can download it manually.
We can do this by heading to this link and searching for the appropriate Command Line Tools for (macOS xx.x) Xcode xx.x and then downloading the .dmg file.
According to our Support Techs, we can skip the installation of Xcode if it is already installed and run the following commands in the terminal:
sudo xcode-select --reset sudo xcodebuild -license
[Looking for a solution to another query? We are just a click away.]
Conclusion
In essence, the skilled Support Engineers at Bobcares demonstrated how to resolve the xcrun error.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
Some Mac Terminal users may discover git, pip, HomeBrew, and other command line tools may fail or not work as intended with an error message stating “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”. Sometimes these command line tools stop working after a macOS system software update, but they worked previously.
Fortunately it’s easy to fix the “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)” error message, and get git, pip, Homebrew, or whatever other command line tool that failed, to start working again.
For what it’s worth, the full error message is:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Fix “xcrun: error: invalid active developer path” Error in Terminal on MacOS
The solution, as you may have guessed from the error message itself, is to reinstall or install Command Line Tools. Yes, even if you already have command line tools installed, you should reinstall it to resolve the error message, particularly if you are only experiencing the error after a system software update (eg, from Mojave to Monterey).
Installing/reinstalling CLT can be done from the command line by issuing the following command string in Terminal:
xcode-select --install
Hitting return will cause a pop-up to appear with a progress indicator on the download for Command Line Tools.
Once the installation of Command Line Tools has completed, you should reboot the Mac (sometimes simply refreshing, relaunching Terminal, or opening a new Terminal may resolve the ‘xcrun error invalid active developer path’ message too, but a reboot is recommended).
If you are using Homebrew, you should also be sure to update Homebrew after you have (re)installed Command Line Tools.
Still seeing xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)?
If you installed or reinstalled command line tools through Terminal, rebooted the Mac, and you’re still getting the error, you can also try to manually install Command Line Tools by using a DMG file directly from Apple.
You will need an Apple ID to access the download, then just head to developer.apple.com and download Command Line Tools for Xcode (latest version) and install it manually.
Again, Homebrew users will want to update Homebrew. You should not have to install Homebrew again or remove it and then reinstall it, a simple update should do the trick.
Did this work to resolve your issues with git, pip, Homebrew, or whatever was triggering the xcrun error message at the command line on your Mac? Did you find another solution? Share your thoughts and experiences in the comments.
The reason you are seeing this error is that your system doesn’t have Xcode installed. Either you have never installed it on your Macbook or it got uninstalled during any OS update.
So to fix this issue, install Xcode. If you are into iOS App development, you can install the complete version and it will solve this issue as well. Download Xcode .dmg file from the Apple developers page.
If you don’t use it, like me, you can simply search for the Command Line Tools package for Xcode and download the .dmg file for it and install it. You can download it from the Apple developers page.
The Perfect Solution:
If you don’t want to download anything and just want to run some commands in the terminal to fix this issue, then here’s the command for you:
xcode-select --install
This is the command which can be run in the terminal and will install the command line tools for Xcode. When you run this command you will be prompted to accept the license, agree with the terms and conditions, etc.
If you are shown that the download requires 7GB+ of space, then be aware you are being forced to download the Xcode Application, in that case, download the .dmg file for command line tools package specifically from the apple developer page.
The above command should fix the issue if it doesn’t run the following command too:
xcode-select --reset
Although this will fix your issue, as a follow-up step, you may need to set the path for the command line tools to run without Xcode.
xcode-select --switch /Library/Developer/CommandLineTools
If you face permission issues while running any of the above commands, use sudo with the commands. For example,
sudo xcode-select --switch /Library/Developer/CommandLineTools
This too can work:
If you have the Xcode app installed, then try running the following command:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Conclusion:
This issue can happen post OS upgrade and can make services that were running well before, useless. But the above solution should fix the error that you are facing. If none of this works for you, feel free to share your error message in the comment section below.
You may also like:
- How to Open a RAR file on your Macbook(macOS)?
- What is Homebrew and How to Install it on Mac OSX
- How to check OS Version of MacBook (macOS)?
- How to Install the AWS EB CLI 3.0 on macOS









