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
. Если эта статья помогла вам, пожалуйста, оставьте комментарий
Спасибо за прочтение!
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.
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
Learn how to deal with the MacOS Git xcrun error.
I didn’t touch my mac for a while and suddenly when I try to work doing something very basic on it, the task surprisingly fails. This time, I tried to simply clone a repository using Git and the error showed up. After some research I ended up with a solution and I want to share with you the cause of this problem and how to solve it.
Before using the solution
- Be sure to update XCode to its latest version. Some developers have claimed that this prevent this kind of error from appearing:
Although some people say that updating XCode fix their problem, it didn’t work in my case. So I had to mess up directly with the command line.
Solution
The exception is caused because of the missing developer command line tools in your system. To solve this problem, simply run the following command in your terminal:
xcode-select --install
Running this command will print the following text in the terminal:
xcode-select: note: install requested for command line developer tools
And will launch a prompt asking for confirmation to install the command line developer tools, be sure to install it:
The installation will take a while, once it finishes, launch a new terminal (close any opened terminal) and try doing whatever you were doing before. In my case, I was simply cloning a repository with Git and it worked as expected. Personally, it’s kind of ridiculous that the command line tools aren’t installed by default but, anyway.
Solution for xcode-select: error: tool ‘xcodebuild’ requires Xcode
If you are working with Node.js and some module that requires node-gyp, you may find the following warning in your terminal:
xcode-select: error: tool 'xcodebuild' requires Xcode
but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
This error occurs when the xcode-select
developer directory was pointing to /Library/Developer/CommandLineTools
when a full regular Xcode was required (happens when CommandLineTools are installed after Xcode). You can easily fix this problem updating the developer directory to the Xcode.app like this:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Happy coding ❤️!