0

I am running Monterey 12.5. My make command suddenly stopped working, prompting me to install Command Line Tools, but after installing from the pop-up I get the error

xcrun: error: invalid DEVELOPER_DIR path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun

and indeed xcrun is missing in that directory. The issue is similar to this post but downloading the dmg and installing the tools manually does not fix my issue. I've tried all the fixes online like sudo xcode-select -r and sudo xcode-select -switch ... with restarts all over the place to no avail. Running xcode-select --install tells me

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

but of course there are no software updates for this.

I am able to run /Library/Developer/CommandLineTools/usr/bin/clang (which gets around tools like gcc which I believe just invoke xcrun to call clang) but nothing seems to be linked as I am met with

loop.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>

If I run gcc from Homebrew, I can run gcc with no input files, but as soon as I run gcc -o loop loop.c I run into the same xcrun error.

In Xcode preferences, Locations/Command Line Tools says Xcode 13.4.1 (13F100) which matches the version of Xcode I have installed.

How can I fix the xcrun error?

1 Answer 1

2

Updating to Xcode 14.2 the other day seems to have fixed it.

xcrun did give the error "SDK/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk" cannot be located but creating a symlink with that name to the newest version fixed it for now. All the tools are working as intended.

You must log in to answer this question.

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