Xcode - use multiple SDKs on Xcode 5

I have a project that requires the iOS 6.1 SDK, and I upgraded to Xcode5 and don’t see the iOS 6.1 SDK in the build settings -> Base SDK. I previously saved the SDK separately and tried to copy it to the /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs Directory. But it does not appear in the build settings -> Base SDKS. How can I use multiple SDKs in Xcode 5?

+6
source share
3 answers

Instead of directly copying, you should use a symlink to avoid deleting previous SDKs for every Xcode update.

1.Open the terminal and navigate to the next SDK directory as shown below.

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

2.Paste SDK 6.1 or your previously desired SDK in documents or in any other directory where it will not be deleted after future updates to Xcode. after you put the SDK in this directory, use the following command to create a symbolic link. (for simplicity, I put the SDK 6.1 in the Documents directory)

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

NOTE. Remember to add a space and a period after the command.

+7
source

In a comment on a deleted answer, you said:

Using the 7.0 SDK caused all kinds of odd rendering problems in my iOS7 applications that I did not manage to fix immediately

I understand this problem here, but I feel compelled to say that I agree with trojanfoe that the best practice is to really use the latest SDK, but feel free to also support any previous versions of iOS that dictate your business requirements. Thus, ideally should:

  • Set your minimum deployment goal as the earliest version of iOS you need to support:

    project target

  • Obviously, write code that supports a range of versions of iOS from everything from a minimal "target" application to the latest version of iOS. This will include the usual range of methods listed in the iOS Support for Multiple iOS Application Programming Guide, namely:

    • Loosely coupled frameworks that may not be supported by your earliest deployment goal

    • execution checks for the existence of classes;

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

    • and etc.

  • Then, if you want to test the simulator for an earlier version of iOS, select the target version of iOS from the scheme menu:

    scheme

    Obviously, you will want to test on older devices still running older versions of iOS (as well as, obviously, the latest versions of iOS) on physical devices. But using a simulator is a quick way to launch an application through its steps against an earlier version of iOS and ensure that you maintain backward compatibility.

I understand your concerns regarding this approach, and I understand that this may not be for you, but I felt compelled to state what I consider “best practice”.

+4
source

If you want to use the previous SDK with xCode 5, just copy the previous sdk file to content-> developer-> patforms-> iPhoneOS.platform Then restart xCode. make sure you open the contents of xCode5 and paste in there.

+1
source

Source: https://habr.com/ru/post/955114/


All Articles