我是否需要卸载 Xcode 4 才能安装 Xcode 5?

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

Do I need to uninstall Xcode 4 to install Xcode 5?

xcodemacosxcode4xcode5

提问by Javide

I have Xcode 4.6.3 installed on OS X 10.8.5. What is the correct way to install Xcode 5? Is it necessary to uninstall 4 first or simply overwrite it?

我在 OS X 10.8.5 上安装了 Xcode 4.6.3。安装 Xcode 5 的正确方法是什么?是否有必要先卸载 4 或简单地覆盖它?

Naturally, I wish to preserve my current settings.

当然,我希望保留我当前的设置。

回答by GayleDDS

I renamed Xcode 4.6.3 to Xcode4.app then installed Xcode 5 as the default Xcode.app, Keeping both versions available. It good practice to verify which Xcode is your default using Xcode-select.

我将 Xcode 4.6.3 重命名为 Xcode4.app,然后将 Xcode 5 安装为默认 Xcode.app,同时保持两个版本可用。使用 Xcode-select 验证哪个 Xcode 是您的默认设置是一个很好的做法。

gdunham: ~$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

example:
    # switch to Xcode 4.6.3
    xcode-select --switch /Applications/Xcode4.app/Contents/Developer

As the others have stated Xcode is a complete self contained package. The SDK's and new tools are contained inside the package contents. Because of this you don't need to install the command line tools just to use git, etc. You can set up aliases and use xcrun to access the command line tool inside the Xcode package

正如其他人所说,Xcode 是一个完整的自包含包。SDK 和新工具包含在包内容中。正因为如此,你不需要安装命令行工具只是为了使用 git 等。你可以设置别名并使用 xcrun 来访问 Xcode 包内的命令行工具

gdunham: ~$ alias git='xcrun git'
gdunham: ~$ git --version
git version 1.8.3.4 (Apple Git-47)

You personal settings are stored in your user account ~/Library/Application Support/Xcodeso they should not change.

您的个人设置存储在您的用户帐户中,~/Library/Application Support/Xcode因此不应更改。

Xcode documentations sets are stored here ~/Library/Developer/Shared/Documentation/DocSetsand shared.

Xcode 文档集存储在这里~/Library/Developer/Shared/Documentation/DocSets并共享。

回答by bneely

You can install Xcode 5 without overwriting Xcode 4. Each copy of Xcode will be a unique path in your /Applications folder.

您可以在不覆盖 Xcode 4 的情况下安装 Xcode 5。Xcode 的每个副本都将是您的 /Applications 文件夹中的唯一路径。

回答by Michael Dautermann

On my machine, I've put my copy of Xcode 4 into a folder I've named "Xcode4".

在我的机器上,我将我的 Xcode 4 副本放入我命名为“Xcode4”的文件夹中。

Then Xcode5 (which is named Xcode.app, just as Xcode4 is) goes where the last version of Xcode went.

然后 Xcode5(它被命名为 Xcode.app,就像 Xcode4 一样)去往上一个版本的 Xcode。

The SDK's and everything else are embedded within each Xcode application package.

SDK 和其他所有内容都嵌入在每个 Xcode 应用程序包中。

回答by Jayprakash Dubey

There is nothing as such any problem in keeping Xcode 4 and Xcode 5. Each of these Xcode has unique path in .../Applications directory.

保留 Xcode 4 和 Xcode 5 没有任何问题。这些 Xcode 中的每一个在 .../Applications 目录中都有唯一的路径

I'm using both Xcode 4 and 5. There haven't any problem in using these. Only you can use one Simulator at a time.

我同时使用 Xcode 4 和 5。使用这些没有任何问题。一次只能使用一个模拟器

Also, the problem that may arise is applications build using Xcode 5 might not open in Xcode 4. Since the changes done in XIB file in Xcode 5 doesn't recognized in Xcode 4. Check-out this link for the same XIB could be read issue

此外,可能出现的问题是使用 Xcode 5 构建的应用程序可能无法在 Xcode 4 中打开。由于在 Xcode 5 中的 XIB 文件中所做的更改在 Xcode 4 中无法识别。可以读取相同XIB 的此链接问题

Hope this might help!

希望这可能会有所帮助!