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...

66 Responses

  1. Marcus Zanona says:

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

  2. Brent Danley says:

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

  3. Garrett Hampton says:

    Thanks a ton!!!

  4. Mara says:

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

  5. Esteban Gallego says:

    Thank you!

  6. Sandeep Malla says:

    Does this mean I need to install XCode?

    • Kola Joseph says:

      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.

  7. Ritam Das says:

    Thanks, simplest solution

  8. Carlos Roso says:

    You deserve a medal sir

  9. Hamada Sidi Fahari says:

    Thanks 😉

  10. Peter Moore says:

    Brilliant, many thanks!

  11. rwxpro says:

    Thank youuuu!

  12. goochin says:

    it work!! thx~~

  13. Noel H says:

    Woooo!! nice, thanks a lot!!

  14. Aditya Ghadigaonkar says:

    Thanks a lot 🙂

  15. Lucas says:

    It worked. Thanks!!!!!

  16. dedmau5 says:

    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

  17. Worked a treat! thank you 🙂

  18. Le dieu hoa says:

    thanks sooooo much!!!!

  19. Karl Pokus says:

    Thanks! Goddamn it apple!

  20. Andres Ramos says:

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

  21. Cristian Oană-Haidu says:

    thx man 🙂

  22. GoofyDawg says:

    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.

  23. Vlad Shevtsov says:

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

  24. 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

  25. Nick says:

    Cheers, this worked!!!

  26. Gustavo says:

    It works like a charm. Thank you so much!

  27. Akash Srivastava says:

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

  28. David Fenlon says:

    What a beautifully simple resolution! Thank you!

  29. Dequn Zhang says:

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

  30. tablatronix says:

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

  31. Phil says:

    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!

  32. William Roger says:

    Thanks!

  33. Gopal says:

    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! 🙂

  34. PeterVermont says:

    Thanks!

  35. Craig R Morton says:

    Great, thanks for sharing.

  36. Го Га says:

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

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

  37. Venu Accha says:

    It solves the problem…..thanks

  38. Purrsia Felidae says:

    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!

  39. Simon Nguyen says:

    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?

  40. M-DEE MUDENDA says:

    Thanks. Had the same problem after upgrading to high sierra

  41. David Poveda (JD) says:

    Hello,

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

  42. Luciano Silva says:

    Thanks, It works now 😀

  43. Khristian Vanier says:

    Thanks! Fixed my issues with running git.

  44. Alon Harel says:

    Thanks a lot, that worked for me.

  45. Brian Jardine says:

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

  46. iKimmyBee says:

    Awesome!! Thank you for the help!

Leave a Reply

Your email address will not be published. Required fields are marked *