Mac OS: xcrun: error: invalid active developer path, missing xcrun

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, November 21, 2019

Follow me on Twitter as @mattiasgeniar

I ran into this error when I tried any git operation (like git clone and git pull) on a Mac. I had just upgraded to the latest OS and suddenly my git broke!

$ git pull
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

The fix, luckily, is pretty straight forward. Install the Xcode toolkit! Even if you had it installed before, you might have to re-register it or update it to the latest version.

$ xcode-select --install

If that doesn’t work, force it to reset. You’ll need sudo access for this one.

$ sudo xcode-select --reset

If even that fails, go to the Apple developer download section and download Xcode manually.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.