"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)" error fix guide for Mac terminal
If you are using a terminal on your Mac, you may encounter an error message "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)". This error is most likely to appear when trying to run certain commands after macOS upgrade.
Fortunately, there is an easy solution to fix this git xcrun error message and get your command line tool back to run. Continue reading to learn what to do next.
What causes xcrun: error: invalid active developer path error
Before we introduce how to fix the xcrun error, let's find out what might be causing it. In most cases, the "xcrun: error: invalid active developer path" error will appear when trying to run git commands in a terminal application after updating or upgrading macOS.
In fact, the error message shown above is very straightforward. It indicates that the active developer path located in /Library/Developer/CommandLineTools is invalid. This means that the xcrun error has nothing to do with git itself, but with command line tools.
How to fix git xcrun: error: invalid active developer path error
Now that you know what might be causing the xcrun error message, let's figure out how to fix it.
Check Xcode.app location
If you receive the message "error: invalid active developer path, missing xcrun: at /Library/Developer/CommandLineTools/usr/bin/xcrun" after upgrading macOS, the Xcode.app may be in the application folder, but the system is looking for it elsewhere. So, to fix this, use the xcode-select -s /Applications/Xcode.app
command to check the location.
Install or reinstall command line tools
Even if you already have command line tools installed, reinstalling them is a good idea to see if it can fix the error message. Here is how to install command line tools:
- On your Mac, open the Terminal Application (go to > Utilities > Terminal)
- In the terminal, type the following command string:
xcode-select --install
and press Enter - You should see the following output:
xcode-select: note: install requested for command line developer tools
- Click the "Install" button
- Then click the "Accept" button to accept the license agreement
- After the installation is complete, restart the terminal.
Hope the above solution will solve your problem. However, if you still encounter xcrun errors, try the following options.
Install CLT from the Apple Developer Download Page
If you have installed or reinstalled the command line tool from the terminal, restarted your Mac, but the error still persists, you can also try manually installing the command line tool by downloading the DMG file directly from Apple.
Visit developer.apple.com and download the latest version of Xcode command line tools. Then install the file manually.
Command line tool forcing the terminal to use Xcode
If the above method does not work, you can try to force the terminal to use Xcode's command line tool. Here are the commands you need to know:
-
sudo xcode-select -reset
-
sudo xcodebuild -license
xcrun: error resolved
Seeing xcrun errors can be frustrating. Most of the time, it appears when trying to run certain commands after upgrading macOS. Fortunately, this problem is solved, hope the above options help you fix the git xcrun error.
The above is the detailed content of How to fix xcrun: error. For more information, please follow other related articles on the PHP Chinese website!

Macs are reliable and trustworthy, but like any computer, they’re prone to errors. It is a nightmare booting up your computer to get your Mac stuck on Apple logo. For iMacs, you may see the spinning wheel cursor or a frozen loading ba

Learn about the energy-saving modes of Mac: Sleep, Sleep, Safe Sleep and Standby You may have noticed that your Mac will go to sleep after a period of inactivity. However, Apple has developed more than one energy-saving model for its computers. This article will take you through all these modes and show you how to switch between them. This article will discuss how to make your Mac hibernate and how to change your Mac's sleep settings with: 4 Mac energy-saving modes The status of a Mac while sleeping How to change the sleep mode of your Mac Mac energy saving mode 1. Mac sleep mode Putting the Mac in Sleep Mode keeps its RAM powered, which allows the Mac to wake up quickly and resume work. Normally, Macs will take a while
![How to create an app in 2025: My step-by-step guide [no code]](https://img.php.cn/upload/article/001/242/473/174554515174947.jpg?x-oss-process=image/resize,p_40)
Create your own app from scratch: a complete guide for 2025 summary: Concept: Verify with Google Trends. Build: Use code-free tools such as SwiftyLaunch, or use Swift for encoding. Tips: Use TypingMind to assist in writing application descriptions. Want to know how to create your own application? Then continue reading! This guide will walk you through every step from conception to listing the app store. Ready? Accelerate iOS application development Enter the details, select the required functions, and SwiftyLaunch will generate the code for you. Available on Setapp. Free trial Security test How to do it in 2025

Encountering the dreaded prohibitory symbol (a circle with a line through it) on your Mac during startup? This indicates a problem with your macOS installation, likely due to incompatibility or corruption. Don't panic; this guide offers several sol

Unwanted browser toolbars can be a nuisance, slowing down your browsing and potentially compromising your security. This guide shows you how to remove them from Safari, Google Chrome, and Mozilla Firefox on your Mac. Remember to back up your Mac wi

macOS Sonoma vs. Sequoia: A Detailed Comparison and Upgrade Guide Choosing between macOS Sonoma and Sequoia? This comprehensive guide highlights key differences and helps you decide which operating system best suits your needs. While both offer rob


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1
Powerful PHP integrated development environment

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

WebStorm Mac version
Useful JavaScript development tools
