can you have multiple SDK's on a MAC?

Is it possible to have multiple SDK versions on a MAC for development of different versions of target?

Replies

Short answer: no.


In the past, Xcode shipped with multiple SDK versions, and you could use any of the SDKs that came with the version of Xcode you were using. Currently, Xcode ships with only the lastest SDK.


You no longer need multiple SDKs to target different versions of macOS. Instead, you write availability tests in your source code to choose different code paths based on the macOS version where your app is running.


You use "if #available …" for Swift, or "if @available …" for Obj-C.

Shorter answer: yes, additional SDKs can be placed in the Xcode bundle.

No, this has never been supported. The fact that ppl did it anyway is no excuse to recommend it, and (with latest availability tests in both Swift and Obj-C), there's no longer any reason to want to do it.

OK, thanks.

I want to develope for iOS 5 so need the associated versions of OSX, xcode and SDK and also for later versions up to and including the latest.

That implies I need more than one bootable OSX.

Does MAC/OSx support multiboot?

If so where can I get the informastion about setting it up?

iOS 5? You can't go back that far in Swift (it requires a deployment target of iOS 7 or higher, or macOS 10.9 or higher).


Anyway, set your target's deployment version (in the project settings) to the earliest OS you want to target. Then, with Xcode 9, the compiler will warn you if you use a newer API without an availability check. (Obj-C availability checking is new in Xcode 9.)


Testing is a little tricky. The first problem is that your Mac will not install or run any version of macOS that's older than the version it had when it was purchased. (That seems counter-intuitive, I know, but it's true.) To get around this, you can install virtualization software such as VMWare or Parallels.


The second problem is that there's no standard way of getting hold of old macOS installers except what's offered to you in the Mac App Store. What's offered to you depends on what you've downloaded from the MAS store in the past. (Check the "purchased" page.)


The third problem is that your current macOS might refuse to download an older installer because it's no longer compatible with its boot procedure (or whatever). Anecdotally, it's supposed to be possible to download anyway by holding down the Option key or something, but I'm not sure that always works.


Anyway, the easiest way to do this is to get hold of the oldest macOS installer you can find (10.5+), use it to set up a virtual OS, then copy the virtual machine and upgrade it from within the copy. That way, you should be able to get a series of virtual machines with successive macOS versions.


You might have similar problems with older iOS simulators. I believe you can download extra simulators that go back a couple of version, but you can't go back very far.


Good luck!

Ok, thanks for all that. Most enlighening for me as a Windows specialist.

I am running vmware as my base system is Windows 10.

I will try and see what back level OSx I can get.

Have you any idea what level OSx is for iOS5?

I believe xcode 4.2 has iO5 SDK support. Would that version of xCode run on that OSx (previous question) or should I go for 3.2.6 which also has iOS 5 SDK support?

I am happy to try and establsih as many virtual Mac's as required.

>(previous question)


(prevous answer in your other thread/same question, I think) - 'see the Xcode wiki' h ttps://en.wikipedia.org/wiki/Xcode


Xcode 4.2, which was first to support iOS 5, requires minimum OS X 10.6.7


>should I go for 3.2.6 which also has iOS 5 SDK support?


Xcode 3.2.6 does not support iOS 5.x.


I'm curious tho, and sorry if I missed it, why you want to build for iOS so far back. The best you can hope I think for is to build to provisioned devices that have been fossilized at that level. Users are not updating/buying apps, and in such low numbers as to be nearly un-measurable. Support for working with older tools is very limited as well.


You may want to move this to, or ask further related questions in, theXcode forum, thanks and good luck.