iOS Developer Tips and Tricks: Multiple BaseSDKs in the same Xcode

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:

baseSDK_open_package

If you click on “show package contents,” you should see folder “Contents.” The baseSDK is located at the following path:

Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

And this is a screenshot of the path:

baseSDK_open_package

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:

multiple_baseSDKs

6. How do I Select the Old baseSDK in my Current Xcode?

Now, open your XCode and follow the steps illustrated below:

select_baseSDKs

Voila, as you can see, you can now use an older baseSDK.

Attila Alexander Teglas has written 58 articles

Attila is a freelance software architect, project manager, consultant, and instructor with more than eight years of experience in the software industry. He developed and managed projects for elite universities, medium-sized companies, multi-national corporations, and the European Union.

He has been developing mobile applications, primarily iOS and Android, for more than five years.

Furthermore, he conducted more than 150+ architecture reviews and audits of mobile apps, scrutinizing and detecting issues & defects for the improvement of these projects.

Regularly, he lectures iOS and Android development to computer science students. Attila rejoices teaching the possibilities and pitfalls of iOS and Android development, giving students the skillset to develop their own high quality apps.

While not writing apps, Attila improves his Chinese and Russian language skills and he travels the world with his beautiful wife.