I had the same problem and had to remove Developer tools completely, and reinstall:
rm -rf /Library/Developer/CommandLineTools
xcode-select --install
rm -rf /Library/Developer/CommandLineTools
xcode-select --install
Tip: because Xcode had been improperly uninstalled, I had to manually (re)move the Xcode app, too:
mv /Applications/Xcode.app/ /Applications/Xcode.app.bak
mv /Applications/Xcode.app/ /Applications/Xcode.app.bak