升级到 Xcode 4.5 后,iOS 5 SDK 消失了

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

iOS 5 SDK is gone after upgrade to Xcode 4.5

iosxcodeios5ios6xcode4.5

提问by Vladimir Grigorov

I upgraded Xcode to version 4.5. Now all of the preferences are reset back to factory settings - editor fonts, colors, etc - but this is not my biggest concern.

我将 Xcode 升级到 4.5 版。现在所有首选项都重置为出厂设置——编辑器字体、颜色等——但这不是我最关心的。

It seems the iOS SDK 5.1 I was targeting is now gone. In project's build settings I can only choose Base SDK between "Latest iOS (iOS 6.0)" and "iOS 6.0". Is it possible to recover the previous installed SDKs?

看来我所针对的 iOS SDK 5.1 现在已经消失了。在项目的构建设置中,我只能在“最新 iOS (iOS 6.0)”和“iOS 6.0”之间选择 Base SDK。是否可以恢复以前安装的 SDK?

回答by Cecilia Humlelu

Download from this link, all sdks should be here. Some nice guy made it

从此链接下载,所有 sdk 都应该在这里。一些好人做到了

http://uv.howett.net/~dhowett/sdks.php

http://uv.howett.net/~dhowett/sdks.php

回答by Martin R

Current Xcode versions come only with the latest iOS SDK (which is a pity, but we cannot change it). Also Apple recommends to always use the latest SDK for building apps, and setting the "Deployment Target" to the minimum version that you plan to support.

当前的 Xcode 版本仅附带最新的 iOS SDK(很遗憾,但我们无法更改它)。此外,Apple 建议始终使用最新的 SDK 来构建应用程序,并将“部署目标”设置为您计划支持的最低版本。

You can copy an SDK (e.g. iPhoneOS5.1.sdk) from an older Xcode to

您可以从旧的Xcode复制一个SDK(如iPhoneOS5.1.sdk)

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

and it will appear in the build settings. But you might run into problems later with this configuration.

它将出现在构建设置中。但是您稍后可能会遇到此配置的问题。

回答by stringCode

In Xcode go to preferences-> downloads and download iOS 5 simulator as well as command line tools. Hope this helped

在Xcode中去首选项 - >下载和下载的iOS 5模拟器以及命令行工具。希望这有帮助

回答by mayuur

Yes!

是的!

When you click on the Simulator selection screen, at the bottom there's a More Simulators button.

当你点击模拟器选择屏幕上,在底部有一个更多仿真按钮。

enter image description here

在此处输入图片说明

However, be sure to set the Deployment Target to whatever Simulator you want to install. In your case, 5.1.

但是,请确保将部署目标设置为您要安装的任何模拟器。在你的情况下,5.1。

Then there will be another window which would show all the Simulators. Just install whichever you want! :)

然后将有另一个窗口显示所有模拟器。只需安装任何你想要的!:)

回答by lupatus

I suppose you meant 'Base SDK' not target - as base SDK you should use latest one, I think there is no way to install 5.1 on Xcode 4.5 (but I can be wrong). You always can set 'Deployment Target' to 5.1 (minimal supported target is 4.3).

我想你的意思是“基础 SDK”不是目标——作为基础 SDK,你应该使用最新的,我认为没有办法在 Xcode 4.5 上安装 5.1(但我可能是错的)。您始终可以将“部署目标”设置为 5.1(支持的最低目标为 4.3)。

Anyway, since Xcode is wrapped inside app bundle, you're able to have two Xcode versions installed parallel if you need.

无论如何,由于 Xcode 包含在应用程序包中,因此您可以根据需要并行安装两个 Xcode 版本。

回答by abbood

In my other laptop that still had XCode 4.2, the location of the iOS 5 SDK was here: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ (as opposed to the location mentioned above)

在我的另一台仍然有 XCode 4.2 的笔记本电脑中,iOS 5 SDK 的位置在这里:/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/(与上面提到的位置相反)

so i just copied it over and voila!

所以我只是复制了它,瞧!

回答by Alex

1) First step: Download your simulator on this link http://uv.howett.net/~dhowett/sdks.php

1)第一步:在这个链接上下载你的模拟器 http://uv.howett.net/~dhowett/sdks.php

2) Second step Unzip and add downloaded simulator in to path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

2)第二步解压并将下载的模拟器添加到路径:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

3) Restart Xcode. (in project settings set Deployment target 5.0 if needed)

3)重新启动Xcode。(如果需要,在项目设置中设置部署目标 5.0)

回答by mike-pz

You only need to install the SDK that you want using the Xcode -> Preferences -> Downloads screen:

您只需要使用 Xcode -> Preferences -> Downloads 屏幕安装您想要的 SDK:

Screenshot of the Downloads panel in Xcode ->Preferences

Xcode ->Preferences 中下载面板的屏幕截图

That will give you iOS5.1 simulator, iOS5.0 simulator, iOS4.3 simulator if you want them.

如果您需要,这将为您提供 iOS5.1 模拟器、iOS5.0 模拟器、iOS4.3 模拟器。

No trickery needed.

不需要诡计。