ios 设置“xcode-select -switch”后Xcode停止工作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9600615/
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
Xcode stops working after set "xcode-select -switch"
提问by Chris Chen
OMG, what I've done?
天哪,我做了什么?
Couple of days ago, I tried using macport to install something, because I'm using Xcode 4.3 and the command-line tool hadn't been installed by the time, macport wouldn't work. So I followed some guide to get command-line tool installed, then I used following command:
几天前,我尝试使用 macport 安装一些东西,因为我使用的是 Xcode 4.3 并且当时还没有安装命令行工具,macport 无法工作。于是我跟着一些指导,让安装的命令行工具,然后我用下面的命令:
sudo xcode-select -switch /Applications/Xcode.app/
which I think screwed everything except macport: now, in Xcode, even a simple single-view iOS project won't be compiled, it says "UIKit/UIKit.h not found".
我认为除了 macport 之外的所有东西都搞砸了:现在,在 Xcode 中,即使是一个简单的单视图 iOS 项目也不会被编译,它会显示“未找到 UIKit/UIKit.h”。
Does anyone know how to correct this? I don't want to re-install the gigantic Xcode again, gotta do some iOS project tonight, help!
有谁知道如何纠正这个?我不想再重新安装巨大的 Xcode,今晚要做一些 iOS 项目,救命!
回答by Jim
You should be pointing it towards the Developer
directory, not the Xcode application bundle. Run this:
您应该将其指向Developer
目录,而不是 Xcode 应用程序包。运行这个:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
With recent versions of Xcode, you can go to Xcode? Preferences…? Locationsand pick one of the options for Command Line Tools to set the location.
使用最新版本的 Xcode,您可以转到Xcode吗?偏好……?位置并选择命令行工具的选项之一来设置位置。