I’m having xcode issues when I try to use brew and git:
xcrun: error: active developer path («/Applications/Xcode.app/Contents/Developer») does not exist, use
xcode-select --switch path/to/Xcode.appto specify the Xcode that you wish to use for command line developer tools (or seeman xcode-select)
I can type xcode-select and it shows that the command exists. When I type xcode-select -p it shows:
/Applications/Xcode.app/Contents/Developer
but when I do which xcode-select, it gives me:
/usr/bin/xcode-select
I’ve tried to use the command switch and install again via Apple Developer site but none of these options have work so far… How can I fix this?
Tobi Nary
4,5514 gold badges29 silver badges50 bronze badges
asked Jan 26, 2016 at 8:24
I tried that and it didn’t work but I found the answer. I just had to reset the developer’s path:
$ sudo xcode-select --reset
Now everything is normal
CopsOnRoad
215k70 gold badges617 silver badges421 bronze badges
answered Jan 27, 2016 at 10:30
devB78devB78
11.4k3 gold badges14 silver badges14 bronze badges
6
Mostly this error occurs when you have installed a newer version of xcode. And the command line tools are yet to be initialized.
To resolve this:
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Please select the Xcode version for tools.
Example (For Xcode 10.0 (10A255) ):
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Select Xcode 10.0 (10A255).
For more details please see this image:
user
4,9646 gold badges17 silver badges35 bronze badges
answered Nov 17, 2016 at 6:21
Harjot SinghHarjot Singh
6,6872 gold badges38 silver badges34 bronze badges
4
In my case, I had uninstalled Xcode and then issues with git cli started. I solved the problem running the following commands:
$ sudo xcode-select -r
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
and then validating new path with:
$ sudo xcode-select -p
user
4,9646 gold badges17 silver badges35 bronze badges
answered Mar 9, 2020 at 21:51
José Gil RamírezJosé Gil Ramírez
2,3811 gold badge12 silver badges7 bronze badges
3
I have faced the same issue as I have uninstalled the XCode abruptly, running the below command (from Terminal) helped me to resolve this.
sudo xcode-select -switch /
answered Jun 12, 2019 at 9:15
2
This error coming because xcode get deleted, corrupt or moved.
In my case i removed xcode from my Mac and faced the same issue.
I fixed it by simple two steps
- Open Terminal
- Simply run following command
sudo xcode-select -r
And now error has resolved. Hope it will helpful.
answered Sep 1, 2021 at 7:22
Amit Kumar PROAmit Kumar PRO
1,2122 gold badges15 silver badges27 bronze badges
3
Use this:
sudo xcode-select -switch /
This should solve the problem.
answered Jun 9, 2018 at 18:43
bruceparkerbruceparker
1,2151 gold badge17 silver badges33 bronze badges
2
How about what the error suggests? Did you try that?
xcode-select --switch /Applications/Xcode.app
That should do the trick.
answered Jan 26, 2016 at 8:31
Tobi NaryTobi Nary
4,5514 gold badges29 silver badges50 bronze badges
1
For me it helps to install Xcode CLI
xcode-select --install
after uninstalling XCode (I don’t develop for the OSx or iOS)
Then I could successfully build downloaded source with make
answered Jan 27, 2019 at 10:59
0
Try error suggestion :
sudo xcode-select --switch /Applications/Xcode.app
And Then test Git Executable Path.
answered May 29, 2020 at 16:51
Mir MahfuzMir Mahfuz
5353 silver badges8 bronze badges
I had the same problem and had to remove completely Developer tools, and reinstall:
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
Tip: because Xcode had been improperly uninstalled, I had to manually (re)move the Xcode app, too:
$ mv /Applications/Xcode.app/ /Applications/Xcode.app.bak
answered Apr 25, 2019 at 8:27
Johann8Johann8
6557 silver badges18 bronze badges
1
In my case such error occurred after I has tried to symbolicate crash report, and according to a manual, entered command export DEVELOPER_DIR=”/Applications/Xcode.app/Contents/Developer”
I tried some proposed here solutions but nothing helped.
Then I realized that I have added an environment variable DEVELOPER_DIR to my terminal and this led to error: «xcrun: error: missing DEVELOPER_DIR path:»
Then I’ve just reboot my terminal, that cleaned the environment variable and the error disappeared.
(FYI: environment variables may be checked with printenv command in terminal)
answered Jan 28, 2021 at 18:22
ViktoRViktoR
6018 silver badges11 bronze badges
0
I’m having xcode issues when I try to use brew and git:
xcrun: error: active developer path («/Applications/Xcode.app/Contents/Developer») does not exist, use
xcode-select --switch path/to/Xcode.appto specify the Xcode that you wish to use for command line developer tools (or seeman xcode-select)
I can type xcode-select and it shows that the command exists. When I type xcode-select -p it shows:
/Applications/Xcode.app/Contents/Developer
but when I do which xcode-select, it gives me:
/usr/bin/xcode-select
I’ve tried to use the command switch and install again via Apple Developer site but none of these options have work so far… How can I fix this?
Tobi Nary
4,5514 gold badges29 silver badges50 bronze badges
asked Jan 26, 2016 at 8:24
I tried that and it didn’t work but I found the answer. I just had to reset the developer’s path:
$ sudo xcode-select --reset
Now everything is normal
CopsOnRoad
215k70 gold badges617 silver badges421 bronze badges
answered Jan 27, 2016 at 10:30
devB78devB78
11.4k3 gold badges14 silver badges14 bronze badges
6
Mostly this error occurs when you have installed a newer version of xcode. And the command line tools are yet to be initialized.
To resolve this:
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Please select the Xcode version for tools.
Example (For Xcode 10.0 (10A255) ):
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Select Xcode 10.0 (10A255).
For more details please see this image:
user
4,9646 gold badges17 silver badges35 bronze badges
answered Nov 17, 2016 at 6:21
Harjot SinghHarjot Singh
6,6872 gold badges38 silver badges34 bronze badges
4
In my case, I had uninstalled Xcode and then issues with git cli started. I solved the problem running the following commands:
$ sudo xcode-select -r
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
and then validating new path with:
$ sudo xcode-select -p
user
4,9646 gold badges17 silver badges35 bronze badges
answered Mar 9, 2020 at 21:51
José Gil RamírezJosé Gil Ramírez
2,3811 gold badge12 silver badges7 bronze badges
3
I have faced the same issue as I have uninstalled the XCode abruptly, running the below command (from Terminal) helped me to resolve this.
sudo xcode-select -switch /
answered Jun 12, 2019 at 9:15
2
This error coming because xcode get deleted, corrupt or moved.
In my case i removed xcode from my Mac and faced the same issue.
I fixed it by simple two steps
- Open Terminal
- Simply run following command
sudo xcode-select -r
And now error has resolved. Hope it will helpful.
answered Sep 1, 2021 at 7:22
Amit Kumar PROAmit Kumar PRO
1,2122 gold badges15 silver badges27 bronze badges
3
Use this:
sudo xcode-select -switch /
This should solve the problem.
answered Jun 9, 2018 at 18:43
bruceparkerbruceparker
1,2151 gold badge17 silver badges33 bronze badges
2
How about what the error suggests? Did you try that?
xcode-select --switch /Applications/Xcode.app
That should do the trick.
answered Jan 26, 2016 at 8:31
Tobi NaryTobi Nary
4,5514 gold badges29 silver badges50 bronze badges
1
For me it helps to install Xcode CLI
xcode-select --install
after uninstalling XCode (I don’t develop for the OSx or iOS)
Then I could successfully build downloaded source with make
answered Jan 27, 2019 at 10:59
0
Try error suggestion :
sudo xcode-select --switch /Applications/Xcode.app
And Then test Git Executable Path.
answered May 29, 2020 at 16:51
Mir MahfuzMir Mahfuz
5353 silver badges8 bronze badges
I had the same problem and had to remove completely Developer tools, and reinstall:
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
Tip: because Xcode had been improperly uninstalled, I had to manually (re)move the Xcode app, too:
$ mv /Applications/Xcode.app/ /Applications/Xcode.app.bak
answered Apr 25, 2019 at 8:27
Johann8Johann8
6557 silver badges18 bronze badges
1
In my case such error occurred after I has tried to symbolicate crash report, and according to a manual, entered command export DEVELOPER_DIR=”/Applications/Xcode.app/Contents/Developer”
I tried some proposed here solutions but nothing helped.
Then I realized that I have added an environment variable DEVELOPER_DIR to my terminal and this led to error: «xcrun: error: missing DEVELOPER_DIR path:»
Then I’ve just reboot my terminal, that cleaned the environment variable and the error disappeared.
(FYI: environment variables may be checked with printenv command in terminal)
answered Jan 28, 2021 at 18:22
ViktoRViktoR
6018 silver badges11 bronze badges
0
I’m having xcode issues when I try to use brew and git:
xcrun: error: active developer path («/Applications/Xcode.app/Contents/Developer») does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)
I can type xcode-select and it shows that the command exists. When I type xcode-select -p it shows:
/Applications/Xcode.app/Contents/Developer
but when I do which xcode-select, it gives me:
/usr/bin/xcode-select
I’ve tried to use the command switch and install again via Apple Developer site but none of these options have work so far… How can I fix this?
I tried that and it didn’t work but I found the answer. I just had to reset the developer’s path:
$ sudo xcode-select --reset
Now everything is normal
Mostly this error occurs when you have installed a newer version of xcode. And the command line tools are yet to be initialized.
To resolve this:
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Please select the Xcode version for tools.
Example (For Xcode 10.0 (10A255) ):
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Select Xcode 10.0 (10A255).
For more details please see this image:
In my case, I had uninstalled Xcode and then issues with git cli started. I solved the problem running the following commands:
$ sudo xcode-select -r
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
and then validating new path with:
$ sudo xcode-select -p
I have faced the same issue as I have uninstalled the XCode abruptly, running the below command (from Terminal) helped me to resolve this.
sudo xcode-select -switch /
This error coming because xcode get deleted, corrupt or moved.
In my case i removed xcode from my Mac and faced the same issue.
I fixed it by simple two steps
- Open Terminal
- Simply run following command
sudo xcode-select -r
And now error has resolved. Hope it will helpful.
Use this:
sudo xcode-select -switch /
This should solve the problem.
How about what the error suggests? Did you try that?
xcode-select --switch /Applications/Xcode.app
That should do the trick.
SolutionFor me it helps to install Xcode CLI
xcode-select --install
after uninstalling XCode (I don’t develop for the OSx or iOS)
Then I could successfully build downloaded source with make
Try error suggestion :
sudo xcode-select --switch /Applications/Xcode.app
And Then test Git Executable Path.
In my case such error occurred after I has tried to symbolicate crash report, and according to a manual, entered command export DEVELOPER_DIR=”/Applications/Xcode.app/Contents/Developer”
I tried some proposed here solutions but nothing helped.
Then I realized that I have added an environment variable DEVELOPER_DIR to my terminal and this led to error: «xcrun: error: missing DEVELOPER_DIR path:»
Then I’ve just reboot my terminal, that cleaned the environment variable and the error disappeared.
(FYI: environment variables may be checked with printenv command in terminal)
I had the same problem and had to remove completely Developer tools, and reinstall:
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
Tip: because Xcode had been improperly uninstalled, I had to manually (re)move the Xcode app, too:
$ mv /Applications/Xcode.app/ /Applications/Xcode.app.bak
Comments Section
—reset normally this must be run as root
Thanks. I had uninstalled xcode and installed just the command line tools because I didn’t need the whole xcode package on my mac with limited space. However, I was still unable to use commands such as gcc, but after running this command, it works like a charm
I just tried it; now I’m getting «SDK «macosx» cannot be located» lol
--resetworks well for me. I need only the xcode cli for php development. So I decided to remove the complete xcode from my mac, then I downloaded only the xcode CLI installer(about 170MB). After I upgrade the installed xcode CLI viaapp store, and appliedsudo xcode-select --reset, I am able to usebrewand other command line tools such asgitlike before. Thanks.
--switchmust be run as root
I already see it as shown in the above image, but I still see the same error on my setup. I even tried resetting. Any idea? I
To do this programmatically (I had the error because I uninstalled Xcode),
sudo xcode-select --switch /Library/Developer/CommandLineTools(needs to be run as root)
Is there any danger in using —reset?
Check this link also if you have any other error. github.com/Homebrew/legacy-homebrew/issues/23500
Check this link also if you have any other error. github.com/Homebrew/legacy-homebrew/issues/23500
This worked for me. The problem was I uninstalled xcode in my mac. The command line is somehow still tied to xcode. So I went to ~library/Developer and deleted all folders and ran this command.
Worked for me after uninstalling xcode, saved my day
I was facing issues on Android Studio after I uninstalled XCode. Worked for me. I also had to restart Android Studio after using these commands.
This works for me after having issue with node-gyp on macOS Catalina
I had to restart my IDE after I did this and then it worked.
It works for MacOS 12.4
xcode-select: error: missing argument to '-switch' Usage: xcode-select [options]
This worked for me. I tried deleting XCode and reinstalling it, and got
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist.
Thank you for showing remove That …… app from that ……. OSx
The comment above is what fixed it for me
Related Topics
path
xcode
xcrun
Mentions
Bharath Kumar
Tobi Nary
Harjot Singh
Cops On Road
Nikolay Ignatyev
Vikto R
Amit Kumar Pro
Guilherme Silva Sousa
Bruceparker
Mir Mahfuz
Starball
References
stackoverflow.com/questions/35009531/xcrun-error-active-developer-path-applications-xcode-app-contents-developer
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.
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.
You may also like:
- How to Open a RAR file on your Macbook(macOS)?
- What is Homebrew and How to Install it on Mac OSX
- How to check OS Version of MacBook (macOS)?
- How to Install the AWS EB CLI 3.0 on macOS
I’m having xcode issues when I try to use brew and git:
xcrun: error: active developer path («/Applications/Xcode.app/Contents/Developer») does not exist, use
xcode-select --switch path/to/Xcode.appto specify the Xcode that you wish to use for command line developer tools (or seeman xcode-select)
I can type xcode-select and it shows that the command exists. When I type xcode-select -p it shows:
/Applications/Xcode.app/Contents/Developer
but when I do which xcode-select, it gives me:
/usr/bin/xcode-select
I’ve tried to use the command switch and install again via Apple Developer site but none of these options have work so far… How can I fix this?
10 Answers
I tried that and it didn’t work but I found the answer. I just had to reset the developer’s path:
$ sudo xcode-select --reset
Now everything is normal
Mostly this error occurs when you have installed a newer version of xcode. And the command line tools are yet to be initialized.
To resolve this:
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Please select the Xcode version for tools.
Example (For Xcode 10.0 (10A255) ):
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Select Xcode 10.0 (10A255).
For more details please see the attached image. Hope it helps.
—
Thanks
In my case, I had uninstalled Xcode and then issues with git cli started. I solved the problem running the following commands:
$ sudo xcode-select -r
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
and then validating new path with:
$ sudo xcode-select -p
Hope this helps!
I have faced the same issue as I have uninstalled the XCode abruptly, running the below command (from Terminal) helped me to resolve this.
sudo xcode-select -switch /
Use this sudo xcode-select -switch /
This should solve the problem.
How about what the error suggests? Did you try that?
xcode-select --switch /Applications/Xcode.app
That should do the trick.
For me it helps to install Xcode CLI
xcode-select --install
after uninstalling XCode (I don’t develop for the OSx or iOS)
Then I could successfully build downloaded source with make
Try error suggestion :
sudo xcode-select --switch /Applications/Xcode.app
And Then test Git Executable Path.
I had the same problem and had to remove completely Developer tools, and reinstall:
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
Tip: because Xcode had been improperly uninstalled, I had to manually (re)move the Xcode app, too:
$ mv /Applications/Xcode.app/ /Applications/Xcode.app.bak
In my case such error occurred after I has tried to symbolicate crash report, and according to a manual, entered command export DEVELOPER_DIR=”/Applications/Xcode.app/Contents/Developer”
I tried some proposed here solutions but nothing helped.
Then I realized that I have added an environment variable DEVELOPER_DIR to my terminal and this led to error: «xcrun: error: missing DEVELOPER_DIR path:»
Then I’ve just reboot my terminal, that cleaned the environment variable and the error disappeared.
(FYI: environment variables may be checked with printenv command in terminal)



