如何更新 Xcode 以安装“UNIX 开发支持”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2693336/
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-09 03:22:06  来源:igfitidea点击:

How to update Xcode to install "UNIX Development Support"?

xcodemacosunixxcode3.2

提问by OscarRyz

I installed Xcode a long time ago.

我很久以前安装了Xcode。

Apparently I didn't check back then the "UNIX Development Support" checkbox.

显然我当时没有检查“UNIX 开发支持”复选框。

Now I want to have them but when I click on the installation this is what appears:

现在我想要它们,但是当我单击安装时,会出现以下内容:

disabled

残疾

The UNIX Development Supportcheck box is disabled

UNIX开发支持复选框被禁用

Q:How can I install the UNIX Development Support? Is there a way to run some script that creates all the needed links from /Developer/to /usr/bin?

问:如何安装 UNIX 开发支持?有没有一种方法来运行一些脚本,从创建所需的所有链接/Developer//usr/bin

EDIT:Note: This is for old Xcode 3. Screens and tool names differ for Xcode 4 ("Unix Command Line Tools")

编辑:注意:这是针对旧的 Xcode 3。Xcode 4 的屏幕和工具名称不同(“Unix 命令行工具”)

采纳答案by OscarRyz

Finally.

最后。

I had to download from Apple's websitethe latest version of Xcode 3 (3.2) along with the iPhone SDK that I won't use in the near feature.

我必须从Apple 的网站上下载最新版本的 Xcode 3 (3.2) 以及我不会在 Near 功能中使用的 iPhone SDK。

This time the "UNIX Development Support" was enabled:

这次启用了“UNIX 开发支持”:

Xcode 3.2 Installation

Xcode 3.2 安装

So now I can compile from the command line!

所以现在我可以从命令行编译了!

回答by eigschpee

With Xcode 4.3 (from Apple App Store) you can enable Unix Command Line Tools via the Xcode Menu: Preferences -> Download -> Components

使用 Xcode 4.3(来自 Apple App Store),您可以通过 Xcode 菜单启用 Unix 命令行工具:首选项 -> 下载 -> 组件

回答by ses3ion

In xcode > 4.5 select Preferences -> Download -> Components -> Command Line Tools

在 xcode > 4.5 中选择 Preferences -> Download -> Components -> Command Line Tools

回答by FabienAndre

In the Xcode .dmgfile, there is a Packagesfolder. You can manually install DeveloperToolsCLI.pkgwhich creates the link in /usr/bin.

在 Xcode.dmg文件中,有一个Packages文件夹。您可以手动安装DeveloperToolsCLI.pkg/usr/bin.

At least, it worked for me.

至少,它对我有用。

回答by Yassir Ennazk

You can also right click the "Install Xcode X.X" icon and Show Package Contents then in Contents > Resources > Packages, you will find many packages from among which resides DeveloperToolsCLI.pkg. This package installs the files you want in /usr/bin.

您也可以右键单击“安装 Xcode XX”图标并显示包内容,然后在 中Contents > Resources > Packages,您会发现其中包含 DeveloperToolsCLI.pkg 的许多包。该软件包将您想要的文件安装在 /usr/bin 中。

回答by Rob Keniger

You should uninstall and then re-install the developer tools.

您应该卸载然后重新安装开发人员工具。

To uninstall the tools, run the following command in Terminal:

要卸载这些工具,请在终端中运行以下命令:

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