Technology3 min read

[SOLVED] Mac OS: xcrun: error: invalid active developer path, missing xcrun

Abhishek Ahlawat

By Abhishek Ahlawat โ€” Recently

Founder of StudyTonight and a MERN fullstack developer. Writes about JavaScript, web development, Linux, and tech.

Summarize this article using AI

The reason you are seeing this error is that your system doesn't have Xcode installed. Either you have never installed it on your Macbook or it got uninstalled during any OS update.

Macos xcrun error solution

So to fix this issue, install Xcode. If you are into iOS App development, you can install the complete version and it will solve this issue as well. Download Xcode .dmg file from the Apple developers page.

If you don't use it, like me, you can simply search for the Command Line Tools package for Xcode and download the .dmg file for it and install it. You can download it from the Apple developers page.

The Perfect Solution:

If you don't want to download anything and just want to run some commands in the terminal to fix this issue, then here's the command for you:

xcode-select --install

This is the command which can be run in the terminal and will install the command line tools for Xcode. When you run this command you will be prompted to accept the license, agree with the terms and conditions, etc.

If you are shown that the download requires 7GB+ of space, then be aware you are being forced to download the Xcode Application, in that case, download the .dmg file for command line tools package specifically from the apple developer page.

The above command should fix the issue if it doesn't run the following command too:

xcode-select --reset

Although this will fix your issue, as a follow-up step, you may need to set the path for the command line tools to run without Xcode.

xcode-select --switch /Library/Developer/CommandLineTools

If you face permission issues while running any of the above commands, use sudo with the commands. For example,

sudo xcode-select --switch /Library/Developer/CommandLineTools

This too can work:

If you have the Xcode app installed, then try running the following command:

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

Conclusion:

This issue can happen post OS upgrade and can make services that were running well before, useless. But the above solution should fix the error that you are facing. If none of this works for you, feel free to share your error message in the comment section below.


Spotted something outdated or wrong?

Liked this? See more StudyTonight posts in Google results.

Add StudyTonight as a preferred source
Next questLIVE OPSStep 2 / 3

Practice real incidents in the browser

System Design Ops โ€” put out fires, ship fixes, and stack XP. Reading done. Time to play.

Play System Design
  • +XP

    Every sim

  • Incidents

    Live ops

  • Ranks

    Climb up

Read next