简体   繁体   English

Xcode 9:如何安装ios 10 sdk

[英]Xcode 9: how to install ios 10 sdk

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? 在Xcode 9 beta中工作时,有没有办法将iOS 10作为基本sdk? Is there need for Apple to package the SDK for Xcode 9 the same way they do for previous OS's in Xc8? 是否需要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)首先想到的是在项目中使用Xcode 9漂亮的新重构工具,该项目涉及需要从iOS 10到11进行更改的代码,但目前在iOS 10上运行。

b) the sake of experimenting.. b)为了试验...

Using this and this I was able to compile against SDK10.3 using Xcode 9 beta 4. It is possible with MANY caveats. 使用这个这个 ,我可以使用Xcode的9 beta 4版本很可能有许多注意事项进行编译SDK10.3。

Caveat 1: The Xcode GUI doesn't seem capable of detecting multiple iPhone SDKs simultaneously. 警告1: Xcode GUI似乎无法同时检测多个iPhone SDK。 So you can't switch back and forth between 10.3 and 11.0 as your base 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. 警告2: Xcode 9附带的swift编译器不支持低于11.0的iPhone模拟器SDK。 You'll encounter this error if you try: 如果您尝试以下操作,您将遇到此错误:

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. 警告3:即使您完成了所有这些操作,在iOS 11启动之前,您仍然不允许提交应用程序以释放它。 The only benefit of using older base SDKs is to take advantage of certain special circumstances in the iOS platform. 使用较旧的基础SDK的唯一好处是利用iOS平台中的某些特殊情况。 One notable example being background VoIP sockets and there are several other examples like it scattered throughout iOS's history. 一个值得注意的例子是后台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. 传统的VoIP架构已被iOS 8中基于PushKit的新架构所取代。随后,iOS 9 SDK正式弃用。 In iOS 10 it is only available as a compatibility measure; 在iOS 10中,它仅作为兼容性度量提供; 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. 如果您的应用程序与旧SDK链接,它会继续工作(以及它曾经做过),但如果您与iOS 10 SDK链接,则会被禁用。

Caveat 4: You can only do it with a purely objective-C project. 警告4:你只能用一个纯粹的Objective-C项目来做。 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: 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: 通过替换此处的文件,将10.0 SDK for Xcode 8.3.3替换为Xcode 9的11.0 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

Xcode 9 beta 4 allows all previous simulators to be downloaded and used. Xcode 9 beta 4允许下载和使用所有以前的模拟器。 No workaround is needed any more, just download the simulator by clicking on the Download simulators menu item shown in picture (last item). 不再需要解决方法,只需单击图片中显示的下载模拟器菜单项(最后一项)即可下载模拟器。

Screenshot : XCode 9 beta mixed simulator versions in list 屏幕截图:列表中的XCode 9 beta混合模拟器版本

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

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