Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - Use multiple SDKs on XCode 5

Tags:

ios

xcode5

I have a project which requires iOS 6.1 SDK and I have upgraded to XCode5 and dont see iOS 6.1 SDK in Build Settings -> Base SDKs. I have earlier SDK saved separately and tried copy-pasting it in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs Directory. But it doesn't show up in Build settings -> Base SDKS. How can I use multiple SDKs in Xcode 5?

like image 967
Obj-Swift Avatar asked Oct 02 '13 15:10

Obj-Swift


3 Answers

Instead of directly copy-pasting you should use symbolic link to avoid deletion of earlier SDKs on each XCode update..

1.Open terminal and go to following SDKs directory as shown below

 cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

2.Paste SDK 6.1 or your desired earlier SDK in the documents or any other directory where it wont be deleted after future XCode updates. once you put the SDK in that directory , use following command to create a symbolic link. (for simplicity i have put SDK 6.1 in Documents directory)

 sudo ln -s /Users/.../Documents/iPhoneOS6.1.sdk .

NOTE: don't forget to add a space and a dot after the command.

like image 137
tinglan Avatar answered Sep 18 '22 19:09

tinglan


In a comment from a deleted answer, you said:

Using the 7.0 SDK caused all kinds of odd rendering issues in my apps on iOS7 that I didn't have time to fix immediately

I understand the issue here, but I feel compelled to say that I agree with trojanfoe, that best practice is that one really should use the latest SDK, but feel free to also support whatever prior iOS versions that your business requirements dictate. Thus, ideally, one should:

  1. Set the minimum deployment target of the app to be whatever the earliest version of iOS you need to support:

    project target

  2. Obviously write code that supports the range of iOS versions from everything from your app's minimum "deployment target" through to the latest iOS version. This will involve the usual spectrum of techniques listed in Supporting Multiple Versions of iOS of the iOS App Programming Guide, namely:

    • weak linking of frameworks that might not be supported by your earliest deployment target;

    • runtime checks for the existence of the classes;

    • runtime checks for respondsToSelector for those methods that are not available in all versions of iOS you're supporting;

    • etc.

  3. Then, if you want to test on the simulator for the earlier iOS version, in the scheme menu, choose the target iOS version:

    scheme

    Clearly, you'll want to test on physical devices still running the old iOS versions (as well as, obviously, the latest iOS versions), too. But using the simulator is a quick way to run the app through its paces against an earlier iOS version and ensure that you maintained backward compatibility.

I understand your concerns regarding this approach and I understand that this may not be for you, but I felt compelled out outline what I believe to be "best practice".

like image 38
Rob Avatar answered Sep 20 '22 19:09

Rob


If you want to use previous SDK with xCode 5, just copy the previous sdk to contents->developer->patforms->iPhoneOS.platform After that restart the xCode. make sure you are opening xCode5 contents and pasting there.

like image 25
Adnan Aftab Avatar answered Sep 21 '22 19:09

Adnan Aftab