I get this error:
xcrun: error: invalid active developer path (/Applications/Xcode.app), missing xcrun at: /Applications/Xcode.app/usr/bin/xcrun
I know this is quite old but I got the same issue and then I fixed it by doing couple more extra steps. Problem came when Terminal could not find the actual path of the Command Line Tools.
xcode-select --print-path
. This would most likely print /Applications/Xcode.app/Contents/Developer
.sudo rm -rf /Library/Developer/CommandLineTools
.sudo xcode-select --install
Now the final step, change the path for the CLT to the actual path using sudo xcode-select -switch /Library/Developer/CommandLineTools/
this will fix it.