iOS Developer Tips and Tricks: Multiple BaseSDKs in the same Xcode
1. Scope of This iOS Developer Tips and Tricks Article
In this article, we will focus on how to use multiple baseSDKs in XCode. In general, knowing how to do this is essential if you need to compile different projects of yours with different baseSDKs. For example, one year ago, you wrote an app with baseSDK “X” and now, a new baseSDK is available with your latest XCode. However, the old baseSDKs are missing and you need them in order to compile your old app.
2. What is an XCode BaseSDK?
First, we need to clarify what an “SDK” is. SDK stands for software development kit. XCode itself is an SDK, meaning it is the tool, namely the software development kit, you utilize for the development for iOS (and Mac OSX) apps. Due to the fact that Apple releases new versions, updates, and bugfixes of XCode on a regular basis, the available changes / new features / improvements are specific to a certain version of XCode.
Now, please read carefully, because you can relatively easily confuse the following two concepts. In Xcode, an SDK is not the same as a baseSDK. To Apple, an SDK is the software development kit a software developer actively uses, namely the XCode. A baseSDK is the collection of features, libraries, frameworks of a specific iOS version, which XCode uses to compile a project against [emphasis added :)].
3. So why is it Important?
Every iOS project requires a baseSDK so that XCode can determine which features, libraries, frameworks in iOS versions up to and including to the one corresponding to the base SDK are available to a specific project. By this, this very project can be compiled against this specific baseSDK. For example, if you compile your project with baseSDK 7.0, then this means your app can only use the features, libraries, and frameworks in iOS versions up to and including to iOS 7.0. As a result, your app compiled against baseSDK 7.0 cannot access new iOS 8.0+ features, because it was not compiled against this later baseSDK version.
As you can see, if you need to maintain different projects that were developed a couple of years ago, you need to know how to tackle different baseSDKs.
4. Where can I Get Older baseSDKs from?
Unfortunately, it is a little cumbersome obtaining older baseSDKs, because there is no list of download links on the iOS developer program website. You need to know that a baseSDK is packaged within XCode. Therefore, if you need an older baseSDK version, you actually need to download an older version of XCode. For instance, if you have the latest XCode version installed (as of December 17, 2014, the latest XCode version is 6.1.1 with baseSDK 8.1) and if you require to use baseSDK 7.0, you would need to download Xcode 5.0.
As a result, download XCode 5.0 from the official Apple Developer Program website. As soon as you downloaded it, then follow the two steps illustrated below:
If you click on “show package contents,” you should see folder “Contents.” The baseSDK is located at the following path:
And this is a screenshot of the path:
Now, copy-paste this folder “iPhoneOS7.0.sdk” at a different folder that you will only use as a temporary place. Also, do not forget the window of the Xcode dmg you opened previously for extracting this baseSDK.
5. How do I Implement the Old baseSDK in my Current Xcode?
The next step is to go to your current Xcode. As in the case of the previously mentioned older Xcode you downloaded, open the contents of your Xcode by right-clicking on the Xcode icon. Then, click on “show package contents.”
Now, in your current Xcode, there exists the same path as in the older Xcode version. Therefore, follow the same path as illustrated above.
As soon as you got to that path, paste the previously copied baseSDK “iPhoneOS7.0.sdk” into this folder “SDKs.” Then, it should look like this in your current Xcode:
6. How do I Select the Old baseSDK in my Current Xcode?
Now, open your XCode and follow the steps illustrated below:
Voila, as you can see, you can now use an older baseSDK.