相关文章推荐

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.

Sign up to join this community

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

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,

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:

But this never solves the problem either.

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

But the problem always returns.

I'm on 12.6 (21G115).

And yes, I've tried rebooting.

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 Sep 22, 2022 at 2:46 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 Sep 22, 2022 at 3:30

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.

@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 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. Marc Wilson Sep 24, 2022 at 19:49

I encountered this.

I fixed it by Uninstalling the Command Line Tools

The reinstalling them from the Apple Developer Downloads

Simples

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

  • Reset Xcode command line tools: sudo xcode-select --reset , then sudo rm -rf /Library/Developer/CommandLineTools
  • Uninstall Xcode.
  • Re-install Xcode command line tools with sudo xcode-select --install .
  • 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.

     
    推荐文章