Sometimes following an OS update, you may be faced with the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
What is xcrun?
xcrun is a helper tool for Xcode. It allows scripts and other applications that leverage Xcode, such as git, to run from any location without knowing where Xcode is installed or even what version it is.
How to Fix
The first step is to verify that XCode tools are installed.
In the terminal, run the following:
$ xcode-select --version
xcode-select version 2354
If it returns a version, you have XCode Tools installed. In this case, the simple fix for the xcrun issue is to reset the XCode configuration.
$ sudo xcode-select --reset
If you still receive the error, you may need to reinstall the Xcode toolkit. Reinstalling it will help ensure you have the latest version correctly configured.
$ xcode-select --install
Sometimes the automatic install still fails to reset the configuration. In this case, you will need to install the Xcode tools manually. To do this, navigate to the Apple developer download section and download the latest version. Follow the instructions to install it.
© 2022, Angela Smith. All rights reserved.