TL;DR: If the standard terminal commands don’t work for uninstalling and reinstalling the Xcode CLI tools, use this page and search for the latest version of the tools to download. You don’t need a developer account to access it.

If you work both in a terminal and on a Mac, then you’re likely familiar with the Xcode Command Line Tools (and the necessary utilities they provide for things like Git, building front-end assets, etc.).

If you’re not familiar, here’s the gist:

[Command Line Tools] enables UNIX-style development via Terminal by installing command line developer tools, as well ass macOS SDK frameworks and headers. Many useful tools are included such as the Apple eLLVM compiler, linker, and Make.

Apple Developer Downloads

Obviously, I’m not an iOS or a macOS developer, but there’s plenty of work that I do in the terminal and I need some of these tools for.

Xcode CLI Tools Won’t Install

Recently, I was faced with a situation in which the standard methods of uninstalling and reinstalling the command line tools didn’t work. (That is, I was looking to use $ xcode-select --install to set up the tools after removing them for reasons outside the point of this post.)

And when I say that I’m looking to install them, I mean doing so after removing any trace of them on the system. And this includes referencing steps also outlined in the following pages:

In short: I was stuck in a position that I needed to get the CLI tools reinstalled, installed at the latest version, and installed as fast as possible.

And thus, back to the initial paragraph of this post: Use this page and search for the latest version of the tools to download. It’ll provide a dmg file for download and it’ll resolve it quickly.