7

For some reason my MacBook is constantly complaining that it needs to install Xcode tools, even if I just installed them seconds before.

dialog box where the computer complains that it needs to install the command line tools

If I hit "Cancel", the same dialog box can reappear in a matter of seconds. (This is effectively Apple DDOSing my brain, but that's a tangential problem.) If I hit "Install" (even though I know it won't work) it start out telling me that it will take some ridiculously long time like 111 hours,

dialog box predicting 111 hours to download and install the command line tools

and eventually it will finish in perhaps 20 minutes. But it will inevitably return, usually seconds later.

I can look at System Preferences and sometimes it will also say I have updates waiting:

System Preferences Software Update window with phantom updates to the Command Line Tools

But this never solves the problem either.

the damned computer can't make up its mind

After hitting "Ok", it might even momentarily act like everything is fine:

laptop pretending it doesn't know what the problem is

But the problem always returns.

I'm on 12.6 (21G115).

And yes, I've tried rebooting.

3
  • 1
    Try resetting xcode-select with sudo xcode-select --reset, then uninstalling the Xcode CLT with sudo rm -rf /Library/Developer/CommandLineTools, and then installing the CLT again with sudo xcode-select --install.
    – Randy
    Commented Sep 22, 2022 at 2:46
  • 1
    Thanks for the tip! I'll try that the next time I have a problem with Xcode tools.
    – iconoclast
    Commented Sep 22, 2022 at 2:47
  • 1
    I have the same problem with homebrew. The command brew doctor always brings up the CLT install. But see my comment following the answer.
    – Gilby
    Commented Sep 22, 2022 at 3:30

3 Answers 3

9

TLDR

just open Xcode if you have it, and let it complete the installation.

Full Answer

Even though I don't use Xcode itself at all and only installed it for the command line tools for other apps that use them, it seems that Apple cannot conceive of this situation, and they don't actually complete the installation until you open Xcode 🤦🏼‍♂️

So if you have the full Xcode, the dialogs that claim to update the command line tools are lying to you. You must open Xcode itself before the update finishes.

6
  • 1
    No, there is no requirement to have the full Xcode installed in order to use the CLT. Commented Sep 22, 2022 at 3:12
  • 1
    Brilliant!! Fixed it for me.
    – Gilby
    Commented Sep 22, 2022 at 3:30
  • 2
    Wow... things seem to be getting worse.
    – Seamus
    Commented Sep 23, 2022 at 14:54
  • @MarcWilson I didn't that there was a requirement to have the full Xcode installed. But I did have it installed—probably because an earlier problem with Xcode tools was resolved by installing the full Xcode—and in my case, that is what resolved the problem. Even though the dialogs claimed to update the command line tools, this was NOT true. It was NOT completed until I opened Xcode itself. I'll edit my answer to help others avoid the same misunderstanding that you had.
    – iconoclast
    Commented Sep 24, 2022 at 18:37
  • I misunderstood this statement "Even though I don't use Xcode itself at all and only installed it for the command line tools for other apps that use them..."? Ok, if you say so. Commented Sep 24, 2022 at 19:49
2

I encountered this.

I fixed it by Uninstalling the Command Line Tools

The reinstalling them from the Apple Developer Downloads

Simples

1
  • This worked for me too.
    – Dogweather
    Commented Dec 27, 2022 at 22:05
2

Here's what's worked for me. It's unclear what steps are optional or not, since I've tried so many combinations:

  1. Reset Xcode command line tools: sudo xcode-select --reset, then sudo rm -rf /Library/Developer/CommandLineTools
  2. Uninstall Xcode.
  3. Re-install Xcode command line tools with sudo xcode-select --install.
  4. While it is installing, go to Systems Preferences and install those 3 updates. Do not close the Xcode command line tools install window while the Systems Preferences does its installing (even if the other window says the install failed), otherwise both will fail. Why does this work? Who knows, Apple writes spaghetti code.

Voila.

1
  • How do install for legacy OS high sierra ? Commented Jun 22, 2023 at 16:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .