Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode-select -switch doesn't work: active developer path does not exist

Tags:

macos

xcode5

I have installed Xcode 5 developer preview 3. Before it i had developer preview 2 and now, sometimes in my terminal I see error, for example when I try to autocomplete some commands by tab:

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

I try to change this directory by executing command:

sudo xcode-select -switch /Applications/Xcode5-DP3.app/Contents/Developer

Now xcode has correct path because command

sudo xcode-select -print-path

shows me result:

 /Applications/Xcode5-DP3.app/Contents/Developer    

but I still see the same error in terminal, see attached: https://dzwonsemrish7.cloudfront.net/items/120Z1S0b1Q302w3J453U/Screen%20Shot%202013-07-24%20at%2016.34.23.png?v=45e9961b

like image 990
Alexandr Subbotin Avatar asked Jul 24 '13 12:07

Alexandr Subbotin


2 Answers

It happened to me once: xcode-select -print-path did stick to the same value and wasn't changing. It appeared that it was always equal to DEVELOPER_DIR environment variable. According to the manpage of xcode-select:

When DEVELOPER_DIR is set, its value will be used instead of the value last passed to -switch xcode_path

So, unsetting DEVELOPER_DIR makes xcode-select -switch working.

like image 197
Roland Avatar answered Sep 28 '22 08:09

Roland


Sometimes, space characters don't allow to take path correctly. So you may prefer to use \ character to include space into the path like below;

$ sudo xcode-select --switch /Applications/Xcode\ 10.2.app/Contents/Developer
like image 44
oguzhan Avatar answered Sep 28 '22 08:09

oguzhan