If we met this issue after mac upgrade
there is two solution
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Go back to your terminal and enter:
xcode-select --install
You'll then receive the following output:
xcode-select: note: install requested for command line developer tools
If it's not work by "Software not found on server", try with solution two
Login or sign up here:
https://developer.apple.com/download/more/
Look for: Command Line Tools for Xcode 12
in the list of downloads