xcode-select -switch不起作用:活动的开发人员路径不存在 [英] xcode-select -switch doesn't work: active developer path does not exist
问题描述
我已经安装了Xcode 5开发人员预览版3.在此之前,我已经安装了开发人员预览版2,现在,有时在终端中会看到错误,例如,当我尝试通过制表符自动完成一些命令时:
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
现在xcode具有正确的路径,因为命令
Now xcode has correct path because command
sudo xcode-select -print-path
显示结果:
/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
推荐答案
一次发生在我身上:xcode-select -print-path
确实保持相同的值,并且没有变化.看来它总是等于DEVELOPER_DIR环境变量.根据xcode的联机帮助页选择:
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:
设置DEVELOPER_DIR时,将使用其值代替该值 最后传递给-switch xcode_path
When DEVELOPER_DIR is set, its value will be used instead of the value last passed to -switch xcode_path
因此,取消设置DEVELOPER_DIR可使xcode-select -switch起作用.
So, unsetting DEVELOPER_DIR makes xcode-select -switch working.
这篇关于xcode-select -switch不起作用:活动的开发人员路径不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!