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
If it prints /Library/Developer/CommandLineTools, you have the standalone Command Line Tools, and the next step removes them. If it prints a path inside Xcode, such as /Applications/Xcode.app/Contents/Developer, your tools came with Xcode: don't delete that folder. Remove Xcode instead, as described under Alternative Ways below.
Step Three
Execute the following command to remove the Command Line Tools folder. Use this path exactly, and never replace it with a path inside Xcode. 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
Xcode includes its own copy of the command line tools. If xcode-select -p printed a path inside Xcode, delete the Xcode app from your Applications folder to remove them.