Delete existing command line tools and install them again.
# uninstall command line toolssudo rm -rf /Library/Developer/CommandLineTools# install command line toolsxcode-select --installDelete existing command line tools and install them again.
# uninstall command line toolssudo rm -rf /Library/Developer/CommandLineTools# install command line toolsxcode-select --install@online{krishnamurthy2022reinstallxcodecommandlinedevelopertools,
author = {Dheepak Krishnamurthy},
title = {Reinstall Xcode command line developer tools},
year = {2022},
date = {2022-02-15},
url = {https://kdheepak.com/blog/reinstall-xcode-command-line-developer-tools/},
langid = {en},
} For attribution, please cite this work as:
Dheepak Krishnamurthy, "Reinstall Xcode command line developer tools", February 15, 2022 https://kdheepak.com/blog/reinstall-xcode-command-line-developer-tools/