Xcode 9:如何安装ios 10 sdk [英] Xcode 9: how to install ios 10 sdk
问题描述
鉴于目前Xcode 9是测试版并且今天的主要兴趣是获得iOS 11的知识,这个问题确实很奇怪......
有没有办法在Xcode 9 beta中工作时将iOS 10作为基本sdk?
Apple是否需要像Xc8中的以前操作系统一样打包Xcode 9的SDK?
为什么会想要这个?
a)首先想到的是在项目上使用Xcode 9漂亮的新重构工具,这些工具涉及需要从iOS 10到11的更改的代码,但是目前在iOS 10上运行。
b)为了试验...
使用
如果您仍然感兴趣
...这是怎么做的。
步骤1
将Xcode 9的11.0 SDK替换为10.3 SDK for Xcode 8.3.3这里的文件:
Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
包含来自此处的文件:
Xcode.app/Contents /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
第2步
在此文件中将 MinimumSDKVersion
值从11.0更改为10.3:
< blockquote>
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
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...
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?
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.
b) the sake of experimenting..
Using this and this I was able to compile against SDK10.3 using Xcode 9 beta 4. It is possible with MANY caveats.
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.
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:
error: Swift does not support the 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 sockets and there are several other examples like it scattered throughout iOS's history.
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.
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:
If You're still interested
... here's how to do it.
Step 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-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
with the files from here:
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Step 2
Change the MinimumSDKVersion
value from 11.0 to 10.3 in this file:
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
这篇关于Xcode 9:如何安装ios 10 sdk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!