How to Add Older Version of iOS Sdk in Xcode 4.5

How can I add older version of iOS SDK in Xcode 4.5

You need to copy the iPhoneOS5.1.sdk to the directory

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk

and iPhoneSimulator5.1.sdk to

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk

(You'll need to restart Xcode to be able to select the SDKs in the Base SDK build option.)

Where to download an slightly older iOS SDK?

The previous versions of SDK are bundled with each version of Xcode, which you can download from https://developer.apple.com/downloads/?name=Xcode. Check this answer https://stackoverflow.com/a/13061104/5806210 on how to add older SDKs. Also you can install other versions of simulators.

Adding Older iOS SDKs to Xcode 4.1 in Lion

Actually it is possible to add older SDKs as long as you can still get your hands on an older version of Xcode with the older SDK. It's useful too sometimes: when you do this you get to find out about unsupported constants and methods you may be using during compile rather than at runtime. Here's how to do it.

  1. Get hold of an older version of Xcode with the older SDK. The Apple iOS Dev Center currently lists the 4.3 SDK with the Xcode 3.2.6 download.

  2. Mount the dmg and open up the Packages folder hidden within the dmg via Terminal:

    open /Volumes/Xcode\ and\ iOS\ SDK/Packages/

  3. Double click the pkg file for the SDK version you want. I was looking for iPhoneSDK4_3.pkg but, in addition to 4.3, found packages as old as iPhoneSDK3_0.pkg. So perhaps older SDKs may still be packaged with the App Store download if you know where to find it (I didn't).

  4. Let it install in it's own folder of choice since you won't be able to force it to install in Applications/Xcode.app/Contents/Developer (which is where the Developer folder is now)

  5. You'll find the package installed in the Platforms folder in the volume you chose. Move the relevant SDK over to the Developer folder within Xcode.app. You'll likely have to use sudo:

    sudo mv /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

  6. Restart Xcode and you should see the new (old) SDK listed in your options for Base SDK. Yay!

Update as of 12 Sep 2013

If the "older SDK" you're trying to add comes bundled in Xcode 4.3 or later, adding the SDK is as simple as downloading Xcode from dev center link that says "Looking for an older version of Xcode?" (currently points here), mounting the dmg, then copying the relevant files over.

In terminal, you'd do something like this (edit for the appropriate SDK version number):

cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

For SDKs from versions of Xcode prior to 4.3, the older steps are still relevant.

I found this happens to work for getting the Xcode 5 GM to compile builds that carry the old iOS 6 UI even when deployed on iOS 7 devices. Useful for fixing bugs pending a UI redesign. That said, there's got to be an easier way to get the iOS 6 UI on an iOS 7 device.

Installing new and old versions of Xcode

I noticed that if I create a new project, I only get the iOS 6.0 simulators, not the 5.0 or 5.1.

Choose your project target and in Summary tab, set the lowest Deployment Target for your app (I think the default value is 6.0 in Xcode 4.5).

My first question is, do I need older versions of Xcode to build apps for older OS (e.g. iOS 4, iOS 5.0, 5.1, etc)?

If you've updated from old version of Xcode, you can use the old SDK & simulator in new version.

If so, what's the best way of installing these older versions of Xcode. I see that they have the command line tools to download as well. I'm not sure how all that stuff works.

Actually, different versions of Xcode can stay happily with each other. It is a App Bundle right now.

third question

Just drag the new version of Xcode to Application folder. That's done. :)

How to point Xcode to an old SDK so it can be used as a Base SDK?

You'll need to add a symlink to the old SDK (this is generally easier than copying).

cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
ln -s /path/to/old/SDK .

This works fine back to 10.5. Beyond that things get a little more complicated...

While there's no promise in future versions of Xcode that this will be supported, I've chatted with the Xcode team about it and they don't seem keen on changing it anytime soon.

Personally I often keep /path/to/old/SDK in a top-level directory called /SDKs. That way every time I upgrade it's easy to fix everything up.

EDIT: I have a fix-xcode script that simplifies re-applying this fix every time Xcode upgrades.


UPDATE: In modern versions of Xcode (7.3+) to use older SDKs edit MinimumSDKVersion here:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist

Xcode 8 with older Base SDK

Starting with Xcode 7.3, in addition to copying in the SDK, you must also edit a certain Info.plist file, as described here for macOS in the post by agx. It looks like there is a similar file for iOS, at

Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist

Try changing the value of MinimumSDKVersion in there from 10.0 to whatever SDK version you want.

I've not tried this with iOS, but, using this workaround, I was just able to build a macOS target with macOS 10.6 using Xcode 8.0 (8A218a) (the "GM").

UPDATE

The hack described above stopped working for me in Xcode 9. If you want to use Xcode 9+, see my more recent answer dated Nov 22, 2017.

App not running on older version of iOS SDK

I dont know why you done this all if you only want to run your app on both iOS 6 and 7.

You can see your app running like on iOS 6 device by simply running the app on iOS 6 simulator with XCode 5 and iOS7 Sdk. You dont have to change your deployment target anyways.

Even if you want to see your XIb in iOS6 pattern,you can do that too in XCode 5. If you want to see that, please revert me i will tell you that too. Or if you want something else, please tell us more precisely. Thanks :)

Installing previous version of iOS on developer device (currently 5.0 - want 4.3.5)

You can download older versions of Xcode by logging into Apple Developer Connection Downloads you will need to be a member of the developer program to login.

Here is the website.

Once on the site, from the Downloads section, choose Developer Tools – you will be shown with a list of all Xcode versions, back to 1.0 released in October of 2004.



Related Topics



Leave a reply



Submit