升级到 OS X Lion 后我应该如何升级 Xcode?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7779300/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:08:30  来源:igfitidea点击:

How should I upgrade Xcode after upgrading to OS X Lion?

xcodeupgradeosx-lionhomebrew

提问by Jakub Arnold

I've just found out, that my homebrew doesn't work anymore after I upgraded to OS X Lion.

我刚刚发现,升级到 OS X Lion 后,我的自制软件不再起作用。

$ brew install clojure
Warning: Xcode is not installed! Builds may fail!
Error: No such file or directory - /usr/bin/cc

and

$ brew doctor
We couldn't detect gcc 4.2.x. Some formulae require this compiler.

We couldn't detect gcc 4.0.x. Some formulae require this compiler.

You have no /usr/bin/cc. This will cause numerous build issues. Please
reinstall Xcode.
Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.

after some googling, I found out that I should upgrade Xcode to version 4.1. The problem is, I have version 3.2.5 installed and I can't find any way of uninstalling it.

经过一番谷歌搜索后,我发现我应该将 Xcode 升级到 4.1 版。问题是,我安装了 3.2.5 版,但找不到任何卸载它的方法。

Xcode

Xcode

When I look at App Store, it looks like I don't have Xcode installed at all. I'm afraid that if I install it via App Store, it will somehow conflict with the version I have currently installed. However I can't find it in Applications, and I can't find any update function either.

当我查看 App Store 时,看起来我根本没有安装 Xcode。我担心如果我通过 App Store 安装它,它会以某种方式与我当前安装的版本冲突。但是我在应用程序中找不到它,我也找不到任何更新功能。

Software Update doesn't prompt me to update Xcode, and I also don't see it in Installed Software.

软件更新不提示我更新 Xcode,我也没有在已安装的软件中看到它。

enter image description here

在此处输入图片说明

What should I do?

我该怎么办?

回答by Jakub Arnold

Thanks to the readme found at /Developer, I found a way to uninstall Xcode via

感谢在 中找到的自述文件/Developer,我找到了一种通过以下方式卸载 Xcode 的方法

$ sudo /Developer/Library/uninstall-devtools --mode=all

edit:I just ran the installer for Xcode 4, and it detected old version of Xcode, offering me to move it to /Developer-old.

编辑:我刚刚运行了 Xcode 4 的安装程序,它检测到旧版本的 Xcode,让我将其移动到/Developer-old.

回答by techarch

I fixed it by

我修好了

In theory this should work if you have Xcode4.3 installed (in /Applications):

理论上,如果您安装了 Xcode4.3(在 /Applications 中),这应该可以工作:

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