简体   繁体   English

Xcode 4.4.1和Xcode 4.5并排

[英]Xcode 4.4.1 and Xcode 4.5 side by side

Anyone have this two versions of Xcode side by side on same machine? 有人在同一台机器上并排有这两个版本的Xcode吗?

I have Xcode 4.4.1 installed and I want to update to latest version (4.5) so I can use iOS 6 SDK, but I need to keep 4.4.1 for some clients. 我安装了Xcode 4.4.1,我想更新到最新版本(4.5),所以我可以使用iOS 6 SDK,但我需要为某些客户端保留4.4.1。

Can I make a simple copy of this version and keep installed after upgrade? 我可以制作此版本的简单副本并在升级后继续安装吗? Because I know some people tried to make this and failed. 因为我知道有些人试图做到这一点而失败了。

  1. Complete a Time Machine backup. 完成Time Machine备份。
  2. Upgrade Xcode to 4.5. 将Xcode升级到4.5。
  3. Restore Xcode 4.4 from the Time Machine backup. 从Time Machine备份恢复Xcode 4.4。 (You may have to go back a few hours, depending on how long Xcode 4.5 took to download. Check the file size.) Keep Both. (您可能需要返回几个小时,具体取决于Xcode 4.5下载的时间。检查文件大小。)保持两者。
  4. Rename Xcode (Original) to Xcode 4.4.1. 将Xcode(Original)重命名为Xcode 4.4.1。

Once you've done this, just run the appropriate version of Xcode. 完成此操作后,只需运行相应版本的Xcode即可。 Xcode 4.5 will update some system components, but these updates won't prevent Xcode 4.4.1 from running. Xcode 4.5将更新一些系统组件,但这些更新不会阻止Xcode 4.4.1运行。

If you use the command line tools, you should use xcode-select to switch between versions or the environment variable DEVELOPER_DIR to pin to a specific version. 如果使用命令行工具,则应使用xcode-select在版本或环境变量DEVELOPER_DIR之间切换以固定到特定版本。

Since Xcode is available on the App Store it's just a regular app. 由于Xcode在App Store上可用,它只是一个常规应用程序。 It doesn't install anything under /Developer that could be overridden if you install a new version. 如果安装新版本,它不会在/Developer下安装任何可以覆盖的内容。 All the required files are inside the app bundle (except preferences, docs - those will be shared by multiple Xcode versions) 所有必需的文件都在应用程序包中(首选项,文档除外 - 这些文件将由多个Xcode版本共享)

If you want to be sure, I recommend the following. 如果你想确定,我推荐以下内容。 Backup the old version (to an external hard disk), install the new version and restore the old version with a different name. 备份旧版本(到外部硬盘),安装新版本并使用其他名称恢复旧版本。

The reason some people failed is that when they downloaded Xcode 4.5 from the Mac App Store it overwrote their existing Xcode 4.4.1. 有些人失败的原因是当他们从Mac App Store下载Xcode 4.5时,它覆盖了他们现有的Xcode 4.4.1。 The Mac App Store will do this if it sees an existing version of Xcode anywhere. 如果Mac App Store在任何地方看到现有版本的Xcode,它将执行此操作。 There are two possible solutions: 有两种可能的解决方案:

  • Don't use the Mac App Store. 不要使用Mac App Store。 It is always possible to obtain any version of Xcode as an ordinary download from the Apple Developer site. 始终可以从Apple Developer站点获取任何版本的Xcode作为普通下载。

  • Use the Mac App Store, but before you do, zip your existing copy of Xcode. 使用Mac App Store,但在此之前,请压缩现有的Xcode副本。 That way, the zipped copy will be kept through the download process. 这样,压缩副本将通过下载过程保留。 Later, you can unzip it. 之后,您可以解压缩它。

Note that two different versions of Xcode cannot exist in the same folder (eg top-level Applications) because they have the same name. 请注意,在同一文件夹(例如顶级应用程序)中不能存在两个不同版本的Xcode,因为它们具有相同的名称。 The easily solution is to put one of them in a subfolder. 简单的解决方案是将其中一个放在子文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM