xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun

Have you upgraded to OS X El Capitan from App Store ?

Have you suddenly started getting the following error in your project?

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

If yes, then here is the solution

xcode-select --install

Remember, in MAC git is attached to XCode’s Command line tools.


You may also like...

  • Marcus Zanona

    Thanks a lot for this. It seems the install flag has a double dash instead? `xcode-select –install`

  • http://brentdanley.com/ Brent Danley

    Thank you! However, because your dash-dash turned into an mdash, copy/paste doesn’t work. #noworries #igotit

  • http://pebutler3.com P.E. Butler III

    Thanks!

    • Timothy Mann

      Fantastic! Thamk you very much

  • Garrett Hampton

    Thanks a ton!!!

  • Mara

    Thank you! Kept me from busting up my homebrew directories.

  • Esteban Gallego

    Thank you!

  • http://www.brianhokke.nl justastranger

    thanks 😀

  • Sandeep Malla

    Does this mean I need to install XCode?

    • Kola Joseph

      I’ve been running the beta of MacOS Sierra for a while now and, apart from the odd niggle (which I’ve obviously reported), all has been fine. That was until I went to use my Subversion client for the first time…

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

      Now, the issue here is that the command line tools are either missing or broken. The same happened after El Capitan, so this appears to be a general issue and one that, sadly, Apple don’t seem to fix.

      The solution is simply to re-install the required software again. Open up a Terminal window and type the following…

      xcode-select –install

      It will take a short while to download and install but it should get you up and working again.

  • http://www.boxofficenews.in/ Ritam Das

    Thanks, simplest solution

  • Carlos Roso

    You deserve a medal sir

  • Hamada Sidi Fahari

    Thanks 😉

  • http://n3rve.com Ralph Rothschild

    Great 🙂

  • http://petemoore.github.io/ Peter Moore

    Brilliant, many thanks!

  • rwxpro

    Thank youuuu!

  • goochin

    it work!! thx~~

  • http://julces.com/ Julio Cesar Martin

    like a sharm! thanks

  • Noel H

    Woooo!! nice, thanks a lot!!

  • Aditya Ghadigaonkar

    Thanks a lot 🙂

  • http://elanandrafa.com themice

    Thank you! <3

  • http://www.lucasvallim.com Lucas

    It worked. Thanks!!!!!

  • http://about.me/dedmau5 dedmau5

    At a “stroaky-beard-meeting” at Apple: “How do we fuck as much as possible with our customers?” “hmm” “yeah lets detach Git from xcode, that will affect like… fifty gazillion users!” “that’s brilliant, Brian! Here, have a raise!”

    … sigh.
    thanks a bunch tho @Kavit

    • tutorialhorizon

      You’re welcome @dedmau5:disqus .

  • http://duckonwater.com/ Duncan Michael-MacGregor

    Worked a treat! thank you 🙂

  • https://www.theriovibe.com/ Dan Bond

    Cheers !

  • Le dieu hoa

    thanks sooooo much!!!!

  • Karl Pokus

    Thanks! Goddamn it apple!

  • http://www.mrg-code.com Andres Ramos

    After updating to macOS Sierra, I had the problem running git command. It works now. Thank you!

    • Ashwani Agarwal

      I’m counting on you, and doing the same with my upgrade

    • http://twitter.com/angelinfante Angel Infante

      Doing the same, thanks 🙂

    • http://shanmdphd.github.io/ Sungpil Han

      I’m not the only one. After having macOS Sierra, the error occurred and this page helped me solving the error.

      • Micheal Bue

        Same for me with Sierra, thanks

    • hanzhimeng

      Same here.

    • Mohammad Entezari

      Same here. Thank you.

    • tutorialhorizon

      You’re welcome. I am overwhelmed with all your sweet comments !

    • Prashant Sharma

      Ditto…

  • Cristian Oană-Haidu

    thx man 🙂

  • GoofyDawg

    Not only does Sierra detach git, if you’re using an IDE like IntelliJ, you’ll lose your JVM! As much as I didn’t like Steve Jobs, this would’ve been a quality issue that he wouldn’t have let happen.

  • Vlad Shevtsov

    Thanks a lot! That helped me! (I’m using macOS Sierra)

  • http://www.brianhokke.nl justastranger

    After mac OS Sierra update, git stopped working. Thank you for this.

    Brackets threw an error:
    Error: git is not installed or not in the PATH

  • Nick

    Cheers, this worked!!!

  • Gustavo

    It works like a charm. Thank you so much!

  • Akash Srivastava

    The one line that brought back the daylights knocked out of me by Apple !! Thanks a lot

  • David Fenlon

    What a beautifully simple resolution! Thank you!

  • http://www.dequn.github.io Dequn Zhang

    Work for me, also caused by macOS. Thank you!

  • tablatronix

    Same problem here with the platformio IDE I use, it uses python netifaces and it was failing to compile it. THANK YOU!

  • Phil

    in case this does *not* fix your problem on macos sierra, you can try the following:

    1. find out where your instance of xcrun sits: `which xcrun`
    2. type the following: `ln -s path/from/step_1 /Library/Developer/CommandLineTools/usr/bin/xcrun`

    that should do it!

  • William Roger

    Thanks!

  • Gopal

    Thank you! After banging my head to n numbers of posts I have finally found this and this worked like magic. You are a savior. Keep up the good work.

    Thank you again! 🙂

  • PeterVermont

    Thanks!

  • Craig R Morton

    Great, thanks for sharing.

  • Го Га

    in Sierra it’s doesn’t work for me.
    Needs one step more:

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

    • Puneet Sandhu

      thank u so much, it wasn’t working for me either 🙂

  • Venu Accha

    It solves the problem…..thanks

  • Purrsia Felidae

    I cannot thank you enough for this! You have really solved a big problem I had. I wish I could buy you a beer! Again, thanks!

  • Simon Nguyen

    One year later, after updating to macOS High Sierra, this problem occurs again, and i couldn’t fix it with the above solution. Does anyone else know how to fix it?

    • Mikey Beck

      I’m using High Sierra and it worked for me…

  • M-DEE MUDENDA

    Thanks. Had the same problem after upgrading to high sierra

  • David Poveda (JD)

    Hello,

    I don’t know where I can put this “xcode-select –install” solution. Can any one help me?

  • Luciano Silva

    Thanks, It works now 😀

  • Khristian Vanier

    Thanks! Fixed my issues with running git.

  • Alon Harel

    Thanks a lot, that worked for me.

  • http://www.jfx.cz Milan Felix Sulc

    Thanks. It helps!

  • Brian Jardine

    Many thanks for posting this. It seems to have solved the issue.

  • http://www.millennialbella.com iKimmyBee

    Awesome!! Thank you for the help!