Xcode 9:如何安装 ios 10 sdk
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44985307/
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
Xcode 9: how to install ios 10 sdk
提问by aaberga
Given the fact that currently Xcode 9 is beta and the main interest today is getting knowledge of iOS 11 the question is admittedly odd...
鉴于目前 Xcode 9 是测试版,而今天的主要兴趣是了解 iOS 11,这个问题无疑很奇怪......
Is there a way to target iOS 10 as base sdk while working in Xcode 9 beta? Is there need for Apple to package the SDK for Xcode 9 the same way they do for previous OS's in Xc8?
在 Xcode 9 beta 中工作时,有没有办法将 iOS 10 作为基础 sdk?Apple 是否需要以与 Xc8 中以前的操作系统相同的方式为 Xcode 9 打包 SDK?
Why would one want this?
为什么会有人想要这个?
a) The first thing that comes to mind is to use Xcode 9 nice new refactoring tools on a project that involves code that needs changes from iOS 10 to 11, but has currently to run on iOS 10.
a) 首先想到的是在涉及需要从 iOS 10 更改为 11 但目前必须在 iOS 10 上运行的代码的项目上使用 Xcode 9 不错的新重构工具。
b) the sake of experimenting..
b)为了实验..
回答by allenh
Using thisand thisI was able to compile against SDK10.3 using Xcode 9 beta 4. It is possible with MANYcaveats.
使用这个和这个,我能够使用的Xcode 9 beta 4版本有可能与进行编译SDK10.3 MANY警告。
Caveat 1:The Xcode GUI doesn't seem capable of detecting multiple iPhone SDKs simultaneously. So you can't switch back and forth between 10.3 and 11.0 as your base SDK.
警告 1:Xcode GUI 似乎无法同时检测多个 iPhone SDK。因此,您无法在 10.3 和 11.0 作为基础 SDK 之间来回切换。
Caveat 2:The swift compiler that comes with Xcode 9 does not support targeting iPhone Simulator SDKs less than 11.0. You'll encounter this error if you try:
警告 2:Xcode 9 附带的 swift 编译器不支持针对低于 11.0 的 iPhone Simulator SDK。如果您尝试,您将遇到此错误:
error: Swift does not support the SDK 'iPhoneSimulator10.3.sdk'
错误:Swift 不支持 SDK 'iPhoneSimulator10.3.sdk'
Caveat 3:Even if you do all of this, you still won't be allowed to submit an app with the intention of releasing it before iOS 11 is launched. The only benefit of using older base SDKs is to take advantage of certain special circumstances in the iOS platform. One notable example being background VoIP socketsand there are several other examples like it scattered throughout iOS's history.
警告 3:即使你做了所有这些,你仍然不能提交一个意图在 iOS 11 发布之前发布的应用程序。使用旧版基础 SDK 的唯一好处是可以利用 iOS 平台中的某些特殊情况。一个值得注意的例子是后台 VoIP 套接字,还有其他几个类似的例子分散在 iOS 的整个历史中。
The legacy VoIP architecture was replaced by a new PushKit-based architecture in iOS 8. It was then formally deprecated with the iOS 9 SDK. In iOS 10 it is only available as a compatibility measure; it continues to work (as well as it ever did) if your app is linked with an old SDK, but is disabled if you link with the iOS 10 SDK.
旧的 VoIP 架构在 iOS 8 中被新的基于 PushKit 的架构所取代。然后它被 iOS 9 SDK 正式弃用。在 iOS 10 中,它仅作为兼容性措施提供;如果您的应用程序与旧 SDK 链接,它会继续工作(和以往一样),但如果您与 iOS 10 SDK 链接,它会被禁用。
Caveat 4:You can only do it with a purely objective-C project. There seems to be some incompatibility between the 10.3 SDK and the version of the swift compiler that comes with Xcode 9. Specifically, this error:
警告 4:你只能用一个纯粹的 Objective-C 项目来做到这一点。10.3 SDK 和 Xcode 9 附带的 swift 编译器版本之间似乎有些不兼容。具体来说,这个错误:
If You're still interested
如果你还有兴趣
... here's how to do it.
...这是如何做到的。
Step 1
第1步
Replace the 11.0 SDK for Xcode 9 with the 10.3 SDK for Xcode 8.3.3 by replacing the files here:
通过替换此处的文件,将 Xcode 9 的 11.0 SDK 替换为 Xcode 8.3.3 的 10.3 SDK:
Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
with the files from here:
使用这里的文件:
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Step 2
第2步
Change the MinimumSDKVersion
value from 11.0 to 10.3 in this file:
MinimumSDKVersion
将此文件中的值从 11.0更改为 10.3:
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
回答by Andras M.
Xcode 9 beta 4 allows all previous simulators to be downloaded and used. No workaround is needed any more, just download the simulator by clicking on the Download simulators menu item shown in picture (last item).
Xcode 9 beta 4 允许下载和使用所有以前的模拟器。不再需要解决方法,只需单击图片中显示的下载模拟器菜单项(最后一项)即可下载模拟器。