Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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...

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..

like image 707
aaberga Avatar asked Jul 08 '17 10:07

aaberga


People also ask

Does Xcode have iOS SDK?

Xcode. Download Xcode 14, which incudes the latest SDKs for iOS, iPadOS, macOS, tvOS, and watchOS.

How do I download SDK from Xcode?

The previous versions of SDK are bundled with each version of Xcode, which you can download from https://developer.apple.com/downloads/?name=Xcode.

How do I find iOS SDK on Mac?

The SDK is located at /Applications/Xcode. app/Contents/Developer/Platforms/MacOSX. platform/Developer/SDKs/MacOSX.


2 Answers

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:

enter image description here

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

like image 101
allenh Avatar answered Oct 10 '22 18:10

allenh


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).

Screenshot : XCode 9 beta mixed simulator versions in list

like image 38
Andras M. Avatar answered Oct 10 '22 20:10

Andras M.