Mac OS Catalina: “invalid active developer path” error

After upgrading to Catalina, I encountered the error below. Seems Xcode was no longer available.


xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Try the following in your terminal; otherwise, head to https://developer.apple.com/download/more/ and download Xcode manually.


xcode-select --install