The Error “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”, is an error that is invoked when you are working on Xcode and have recently updated your mac’s operating system. Given below is the snippet of the error you might get:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I would like to share with you the steps I took to fix the “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”
Why “xcrun error invalid active developer path (/Library/Developer/CommandLineTools)” Error is Seen?
The error, “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)” is seen because the problem is from Apple’s technical front and they should be taking care of it in the upcoming updates.
The new apple updates causes issues with the Xcode command line tools and as a work around for it your Xcode Command-line Tools needs to be updated to the latest version once apple fixes the error.
The detailed solution to fix the error “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”, is given below:
How to Fix “xxcrun error invalid active developer path (/Library/Developer/CommandLineTools)” Error?
To fix the error, you will have to update your Xcode Command-line Tools. To update Xcode, either go through terminal and update your command line tools automatically or go to apple developer website and find “Command Line Tools for Xcode 12.x” in the list of available downloads.
You can update your Xcode Command-line Tools directly from apple official website.
To fix the error, “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”, you will have to follow one of the below-mentioned methods:
Method 1: Directly using Terminal
First you will have to go to the terminal and enter the below mentioned code:
xcode-select --install
After typing the above mentioned code you will then receive the below mentioned output:
xcode-select: note: install requested for command line developer tools
It may take a while but then you will then be prompted to a window to update Xcode Command Line tools.
Once you open a new terminal window, your development tools should be returned.
Note: whenever there is any major or semi-major update, you will have to need to update the command line tools in order to get them functioning properly again if any issue is seen with the current Xcode version.
This should fix the error, “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”
Method 2: Directly through the Website
If the above method doesn’t work then to fix the error, you need to run the following code in your terminal: xcode-select --install
and if doesn’t find the software you will have to log into Apple Developer account on official Apple Developer page, and install it through a webpage.
Log in or sign up in the apple developer website, you can find the link to it here:
Then you will have to find the following tab: “Command Line Tools for Xcode 12.x” in the list of downloads Then you have to download the dmg.


This should fix the error, “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”
Conclusion
To fix the error “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)”, you will have to update your Xcode Command-line Tools.
To do this either by going through terminal and updating your command line tools manually or Alternatively you code go to developer apple website and find “Command Line Tools for Xcode 12.x” in the list of downloads.
You can update your Xcode Command-line Tools directly from there.