The xcrun error invalid active developer path library developed Commandline tools error is a common error that can occur when trying to use the Xcode command line tools. This error is caused by an invalid or missing developer path, and can usually be resolved by setting the correct path in the Xcode preferences.
What is the xcrun Error?
The “xcrun error invalid active developer path” error is a common error that occurs when trying to use the “xcrun” command in the Terminal. An outdated or invalid Xcode installation usually causes this error.
There are two ways to resolve this issue:
- Update your Xcode installation to the latest version.
- Uninstall your current Xcode installation and then install the latest version.
How to Fix the xcrun Error
You may see the following error when trying to use certain developer tools on your Mac: “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),” This error is caused by having multiple copies of the Xcode Command Line Tools installed on your computer. In this article, we’ll show you how to fix this error.
Option 1: Use Xcode Command Line Tools
The first thing you can try is using the Xcode Command Line Tools. This will install the necessary tools to fix the xcrun error on your system.
To do this, open Terminal and type the following:
If you see a popup window asking if you want to install the tools, click “Install”. Once the installation is finished, try running your command again.
Option 2: Set the PATH Environment Variable
- Open the Terminal application.
- Type the following command and press Enter:
sudo xcode-select -s /Library/Developer/CommandLineTools
- Type your password when prompted, and then press Enter again.
- Close the Terminal window.
The active developer path is a directory that contains the developer tools, such as xcodebuild and xcrun. In order to use the tools, you must set the path to the directory that contains them.
If you receive the error message “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),” this means that the directory that contains the developer tools is not in your path. To fix this, you must add the directory to your path.
There are two ways to do this:
- Use the “export” command to add the directory to your path. This method will only work for the current session. To make the change permanent, you must add the “export” command to your shell configuration file (such as ~/.bash_profile).
- Use the “sudo xcode-select -switch” command to change your active developer directory. This method will make the change permanent.