安装新旧版本的 Xcode
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12575310/
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
Installing new and old versions of Xcode
提问by Crystal
So I saw this post: http://mobiledevelopertips.com/xcode/download-and-install-older-versions-of-xcode-xcode-previous-releases.html
所以我看到了这篇文章:http: //mobiledevelopertips.com/xcode/download-and-install-older-versions-of-xcode-xcode-previous-releases.html
(new location: at iosdevelopertips.com)
(新位置:在 iosdevelopertips.com)
about downloading older versions of Xcode. Up to now, I have always just downloaded the newest version of Xcode from the App Store and let it do its thing. Recently on one computer that has Xcode 4.5 installed on it, I noticed that if I create a new project, I only get the iOS 6.0 simulators, not the 5.0 or 5.1.
关于下载旧版本的 Xcode。到目前为止,我一直只是从 App Store 下载最新版本的 Xcode 并让它做它的事情。最近在一台安装了 Xcode 4.5 的计算机上,我注意到如果我创建一个新项目,我只能得到 iOS 6.0 模拟器,而不是 5.0 或 5.1。
My first question is, do I need older versions of Xcode to build apps for older OS (e.g. iOS 4, iOS 5.0, 5.1, etc)?
If so, what's the best way of installing these older versions of Xcode. I see that they have the command line tools to download as well. I'm not sure how all that stuff works.
What's the best way to update to the latest Xcode but keeping the old Xcode around? On a different machine that had Xcode 4.4.1 installed, I thought I could download Xcode 4.5 from the ADC website and install it. I downloaded it, double-clicked on the .dmg, then double-clicked on the Xcode file. This then installed Xcode 4.5 without asking me where I wanted it installed so I could keep the older version of Xcode (assuming that I need it as stated in my 1st question).
我的第一个问题是,我是否需要旧版本的 Xcode 才能为旧操作系统(例如 iOS 4、iOS 5.0、5.1 等)构建应用程序?
如果是这样,安装这些旧版本 Xcode 的最佳方式是什么。我看到他们也有命令行工具可供下载。我不确定所有这些东西是如何工作的。
更新到最新 Xcode 但保留旧 Xcode 的最佳方法是什么?在另一台安装了 Xcode 4.4.1 的机器上,我想我可以从 ADC 网站下载 Xcode 4.5 并安装它。我下载了它,双击 .dmg,然后双击 Xcode 文件。然后安装了 Xcode 4.5,而没有问我想把它安装在哪里,这样我就可以保留旧版本的 Xcode(假设我需要它,如我的第一个问题所述)。
Thanks!
谢谢!
采纳答案by Kjuly
I noticed that if I create a new project, I only get the iOS 6.0 simulators, not the 5.0 or 5.1.
我注意到如果我创建一个新项目,我只会得到 iOS 6.0 模拟器,而不是 5.0 或 5.1。
Choose your project target and in Summary
tab, set the lowest Deployment Targetfor your app (I think the default value is 6.0 in Xcode 4.5).
选择您的项目目标并在Summary
选项卡中,为您的应用程序设置最低的部署目标(我认为 Xcode 4.5 中的默认值为 6.0)。
My first question is, do I need older versions of Xcode to build apps for older OS (e.g. iOS 4, iOS 5.0, 5.1, etc)?
我的第一个问题是,我是否需要旧版本的 Xcode 才能为旧操作系统(例如 iOS 4、iOS 5.0、5.1 等)构建应用程序?
If you've updated from old version of Xcode, you can use the old SDK & simulator in new version.
如果您从旧版本的 Xcode 更新,您可以在新版本中使用旧的 SDK 和模拟器。
If so, what's the best way of installing these older versions of Xcode. I see that they have the command line tools to download as well. I'm not sure how all that stuff works.
如果是这样,安装这些旧版本 Xcode 的最佳方式是什么。我看到他们也有命令行工具可供下载。我不确定所有这些东西是如何工作的。
Actually, different versions of Xcode can stay happily with each other. It is a App Bundle right now.
实际上,不同版本的 Xcode 可以愉快地相处。它现在是一个 App Bundle。
third question
第三个问题
Just drag the new version of Xcode to Application folder. That's done. :)
只需将新版本的 Xcode 拖到 Application 文件夹中即可。大功告成。:)
回答by Mark
To answer your questions:
回答您的问题:
1) Yes. I renname Xcode to add the version number (i.e. Xcode_441.app)
1) 是的。我重命名 Xcode 以添加版本号(即 Xcode_441.app)
2) I keep an archive of all versions of Xcode that I have downloaded so they are available after Apple pulls them from their download site.
2) 我保存了我下载的所有 Xcode 版本的存档,以便在 Apple 从他们的下载站点中提取它们后可用。
3) Renaming them works for me, and I usually grab the direct download, when available, instead of getting it from the MAS. Try renaming Xcode before doing an install.
3)重命名它们对我有用,我通常会直接下载(如果可用),而不是从 MAS 获取。在安装之前尝试重命名 Xcode。
You are welcome.
不客气。
回答by bryanmac
It's possible to have multiple XCode installations by customizing the install path. Also note that the new 4.x install model is app bundles under Applications which are self contained so it's possible to just rename the old before installing the new XCode. You can also download the newest (4.5) from the developer site.
通过自定义安装路径可以有多个 XCode 安装。另请注意,新的 4.x 安装模型是自包含应用程序下的应用程序包,因此可以在安装新 XCode 之前重命名旧模型。您还可以从开发人员站点下载最新的 (4.5)。
You can also add the old simulators by going to XCode preferences in 4.5.
您还可以通过转到 4.5 中的 XCode 首选项来添加旧模拟器。
Look under XCode, preferences, downloads. XCode 4.5 offers the 5.0 and 5.1 simulators for download. The same place that you download the command line tools.
在 XCode、首选项、下载下查看。XCode 4.5 提供 5.0 和 5.1 模拟器供下载。与您下载命令行工具的位置相同。
For example, I added the 5.0 Simulator to my XCode 4.5 installation to go along with the 6.0 Simulator:
例如,我将 5.0 Simulator 添加到我的 XCode 4.5 安装中以与 6.0 Simulator 一起使用: