Change active Developer Path for Xcode
Asked Answered
P

6

15

This question was asked before, but unresolved here.

I have tried the solution here, but it doesn't solve the issue.

I get this error:

xcrun: error: active developer path ("/Applications/Xcode 2.app/Contents/Developer") does not exist, use xcode-select to change

The active developer path should NOT say "Xcode 2.app", but instead "Xcode.app".

My question is: How can I change the active path to say "Xcode.app"?

I already tried the following:

$> xcode-select -switch /Applications/Xcode.app/Contents/Developer
$> xcode-select -print-path 
/Applications/Xcode.app/Contents/Developer

I have tried reinstalling Xcode, but the problem persists.

Pairoar answered 27/3, 2014 at 6:35 Comment(1)
The solution worked for meFrisket
P
-1

Doing a hard reset on my computer fixed my issue.

I agree that the answer below, the one with the most upvotes, is helpful to most people who encounter this problem.

Pairoar answered 6/2, 2016 at 6:29 Comment(0)
V
65

Have you tried to execute the switch command as root with a sudo command ?

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Verona answered 22/4, 2014 at 17:6 Comment(4)
+1 It works perfectly , this should be accepted as an Answer.Vilberg
Agreed, this worked. OP should revisit to accept this answer.Floorwalker
I cannot accept this answer because it did not solve my issue, which is a bit more involved. Though I'm glad it's helped people!Pairoar
I have been trying sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer , but it shows me sudo: xcode-select: command not foundGlynas
A
16

There is one more option without terminal, we can change active developer path through Xcode.

Launch Xcode, Go to Xcode -> Preferences -> Locations and in Command Line tools will list down all the installed Xcode list. From the drop down you can select any Xcode for active developer path.

Using this selection, you can set any Xcode (if you have multiple installed Xcode’s in your machine and you want change default one) set as a default active developer path.

Happy Coding :)

Ardeen answered 28/1, 2016 at 8:56 Comment(1)
Thanks. It helped me.Complete
H
1

Hovanter, There is a possibility that you have multiple Xcode versions in your Application folder. Also you might have updated the name of your Xcode.

Search your 'Xcode name' from Application folder and then enter the command below : sudo xcode-select -switch /Applications/"Xcode name.app"/Contents/Developer

It worked for me. How about you?

Haloid answered 15/1, 2015 at 19:1 Comment(1)
This should be a comment (once you have enough reputation to add one) instead of an answer. Please refer to the Help Section to learn how to earn reputation and therefore be able to comment.Phrasing
P
1

It Occurs to me when i renamed my Xcode application to xcode6.4

You have to give new path by replacing Xcode to renamed Xcode application

Example:- sudo xcode-select -switch /Applications/Xcode6.4.app/Contents/Developer

Protrusile answered 5/10, 2015 at 5:14 Comment(0)
C
0

If xcode is yet not installed, then this error occurs. So, Install xcode then go for checkout.

Callisto answered 9/4, 2015 at 11:9 Comment(0)
P
-1

Doing a hard reset on my computer fixed my issue.

I agree that the answer below, the one with the most upvotes, is helpful to most people who encounter this problem.

Pairoar answered 6/2, 2016 at 6:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.