These are instructions on how to uninstall Xcode Command Line Tools on Mac. You may need to follow these steps if you've installed Xcode Command Line Tools without Xcode.
The Command Line Tools package is a small self-contained package available for download separately from Xcode that allows you to do command line development in macOS. It consists of the macOS SDK and command-line tools such as Clang, the Apple LLVM compiler, linker, and Make, which are installed in the /Library/Developer/CommandLineTools directory. If you use Xcode, these tools are also embedded within the Xcode IDE.
Follow the steps below to get started...
UNINSTALL XCODE COMMAND LINE TOOLS
Step One
Launch Terminal from your dock or from the Applications > Utilities folder.
Step Two
Execute the following command to locate your Xcode Command Line Tools installation folder:
xcode-select -p
Step Three
Execute the following command to remove the installation folder, replacing the path below if it differs from the one shown in the previous step. Warning: You cannot undo this step!
sudo rm -rf /Library/Developer/CommandLineTools
Enter your administrative user password when prompted.
Step Four
You can use the following command to ensure the folder has been removed successfully.
ls -la /Library/Developer
ALTERNATIVE WAYS TO UNINSTALL XCODE COMMAND LINE TOOLS
Xcode
If you installed Xcode Command Line Tools alongside the Xcode application itself, uninstalling the Xcode application should remove the tools as well.