After upgrading to macOS Mojave 10.14, Xcode was no longer updating correctly and my build process was reporting that stdlib.h was missing. Thus, I attempted to uninstall it so I could reinstall it after.

However, after removing it via the (x) button displayed on the Xcode app icon in Launchpad, the app was still in /Applications directory. So I deleted it from there as well.

However, the Mac App Store is still showing the option to update Xcode as if it were installed (and clicking the button resulted in a loading animation being displayed for half a second and then the update button again). I have also removed all the various folder listed here:

as well as followed the instructions to empty the Mac App Store cache provided here:

and here:

So far, nothing has changed the fact that the Mac App Store thinks I should update instead of install.

Is there anything else to do to get the Mac App Store to reinstall Xcode?

If it's easier, I'd be content with installing LLVM via Homebrew without messing things up. I don't really need Xcode itself, only the build tools.

xcode-select --install behaves similarly to the Mac App Store (namely claiming the tools are already installed or producing a non-working installation if I remove the CommandLineTools directories in the different Libraries).

EDIT: after some more back-and-forth I managed to get the Command Line Tools working via xcode-select --install. However, I'm still left with the update notification for Xcode in the Mac App Store.


What finally solved the problem for me was to download and install the Command Line Tools as well as Xcode (in that order) from the Apple developer site. After the next reboot, the Mac App Store recognised Xcode as not installed and all standard libraries and compilers were available again (which was not quite the case with Command Line Tools only).


You might need to forget the package. :EDIT

Every package installed via Apple tools is recorded.

You can use pkgutil to find out which files were installed.

man pkgutil

pkgutil --pkgs #the packages installed on the system

pkgutil --files package-id # installed files

Remove these files. Job's not quite done, though. Depending on your use case, you might want all knowledge of this install to be removed.

pkgutil --forget package-id # this never happened.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.


I just reinstalled Xcode yesterday for an issue and I was encountering something similar. Finally, I

  • removed Xcode (just drag to trash and empty it)
  • rebooted machine
  • installed Xcode from store
  • installed command-line tools
  • rebooted

Stuff seems to work once again.

  • Unfortunately this does not work for me. As described in my question, I cannot install Xcode because - even though it was thoroughly uninstalled - the AppStore is still convinced that it is installed and continues trying to update the no-longer-existing application. – Jan Hettenkofer Apr 9 at 12:53

You must log in to answer this question.

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