Is it possible to install iOS 6 SDK on Xcode 5?

134,697

Solution 1

EDIT: Starting Feb 1, 2014, Apple will no longer accept pre-iOS7 apps for submission to App Store. So while this technique still works, it will not be useful for most readers.


Yes, this is fine. I still build with iOS 4.3 for one project (it's been awhile since we updated; but they still accepted it after iOS 6 came out), and I currently build 10.5 apps with Xcode 5.

See How to point Xcode to an old SDK so it can be used as a "Base SDK"? for details on how to set it up. You can use my fix-xcode script to link everything for you every time you upgrade.

The only trick is getting the old SDKs. If you don't have them, you generally need to download old versions of Xcode (still available on developer.apple.com), open the installer package, and hunt around to find the SDK you need.

SDKs can be found within the installer package at:

Xcode.app/Contents/Developer/Platforms/

Solution 2

I was also running the same problem when I updated to xcode 5 it removed older sdk. But I taken the copy of older SDK from another computer and the same you can download from following link.

http://www.4shared.com/zip/NlPgsxz6/iPhoneOS61sdk.html
(www.4shared.com test account [email protected]/test)

There are 2 ways to work with.

1) Unzip and paste this folder to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs & restart the xcode.

But this might again removed by Xcode if you update xcode.

2) Another way is Unzip and paste where you want and go to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs and create a symbolic link here, so that the SDK will remain same even if you update the Xcode.

Another change I made, Build Setting > Architectures > standard (not 64) so list all the versions of Deployment Target

No need to download the zip if you only wanted to change the deployment target.

Here are some screenshots. enter image description here enter image description here

Solution 3

Yes, I just solved the problem today.

  1. Find the SDK file, like iPhoneOS6.1.sdk, in your or your friend's older Xcode directory.
  2. Copy & put it into the Xcode 5 directory : /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs.

enter image description here

Then you can choose the SDK like below :

enter image description here

Hope this helps you.

Solution 4

Find and download old SDK. Older SDKs are found here.

I have copied the xcode.app directory as Xcode_4.6.3.app.

Now you can test and debug in both xcode versions. You have to run them from the corresponding folders or create shortcuts in your desktop. When building from command line give the parameter as iPhoneOS6.1 instead of iPhoneOS7.0

This worked great for me in Xcode5 and iOS.

Go to into Xcode5's SDK dir. Its usually located at:

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

Add a symbolic link to the old SDK like this:

sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk iPhoneOS6.1.sdk

Or more accurately from anywhere in the command line,

sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk

Solution 5

Just to add, you can actually download old versions of the simulator with Xcode 5 itself - just go to preferences and you'll find them under Downloads:

enter image description here

Share:
134,697

Related videos on Youtube

Tony
Author by

Tony

Updated on July 17, 2022

Comments

  • Tony
    Tony almost 2 years

    Xcode 5 has a preferences pane that allow one to download iPhone 6.1 simulator, however I can't find a place where it allows downloading of iOS 6 SDK, thus it is not possible to set the active SDK to iOS 6 when developing with Xcode 5. Is there a workaround that would allow Xcode 5 to install iOS 6 SDK?

    EDIT:

    Workarounds should no longer be necessary now that Xcode 5 is generally available and allows you to download previous versions of the SDK.

    enter image description here

    • Tony
      Tony almost 11 years
      To take advantage of many improvements in Xcode 5, while still being able to build app for today's app store.
    • Marchy
      Marchy almost 11 years
      Hey maddy, the point about "embracing iOS 7 anyways" is totally not tied to the GA release. The decision and effort of redesigning an app's whole design language and UX to come in line with the flat design and re-designed iOS7 UI components is neither small, nor can come easily from a business & timing perspective. Building against SDK 6.1 will have iOS7 use the UI design language of iOS 6 and prior (for backwards support purposes). Thus it may be very well-warranted that we want to develop in Xcode 5 against the 6.1 SDK for some good time to come.
    • phreakhead
      phreakhead over 10 years
      hmmm maybe because he expects the SDK to be separated from the IDE, instead of one monolithic pile of code?
    • Droid Chris
      Droid Chris over 10 years
      I am currently working with a client that is not ready to embrace the IOS7 UI changes, but can benefit from the Core Data migration improvements in XCode 5. So in this case, this is exactly what I want as well.
    • JohnK
      JohnK over 10 years
      One might think that Xcode, if not including SDK 6.1, would at least integrate it smoothly. But then there's this problem.
  • ohayon
    ohayon almost 11 years
    do you need to remove the iOS 7 SDK when archiving to ensure that it builds with the iOS 6 SDK?
  • Jason
    Jason almost 11 years
    For what it's worth, you need to copy the simulator SDKs too, and then be sure to run the simulator against the right version.
  • Rob Napier
    Rob Napier almost 11 years
    Agreed. The recent edit to this answer pointed people to the iPhoneOS SDKs. I've re-edited the answer to include all the SDKs (you'll want Mac SDKs if you develop for Mac).
  • Sam B
    Sam B almost 11 years
    how and where did you download this ios6.1 sdk? I am looking for iOS 5 sdk to run against my Xcode 5. Can you either upload that or point in me where I can download it myself. Thank you
  • AvtarSingh Suchariya
    AvtarSingh Suchariya almost 11 years
    Actually, I am having the old system also. so I taken this from older xcode. The same I tried for ios sdk 5 but as not much needed I not tried to get that out from. Also, if this answer seems good, I value your feedback in terms of + or -. Thank you.
  • Sam B
    Sam B almost 11 years
    Hey Avtar, I downloaded your ios6 zip, unzipped it under the location path that you had listed, closed xcode 5 completely, relaunched it again and yet I still see only 7.0 as deployable target in drop down option. I assuming there are missing steps and there is more to it?
  • AvtarSingh Suchariya
    AvtarSingh Suchariya almost 11 years
    The same is working for me. Just a question, did you added this into xcode app itself or created a symbolic link ?
  • Sam B
    Sam B almost 11 years
    directly to app dir itself.
  • AvtarSingh Suchariya
    AvtarSingh Suchariya almost 11 years
    Well, The same I did and it showing options from 4.3 to 7.0. But yes I installed all the simulator also. not sure that might effect.
  • AvtarSingh Suchariya
    AvtarSingh Suchariya almost 11 years
  • AvtarSingh Suchariya
    AvtarSingh Suchariya almost 11 years
    another change I made, Build Setting > Architectures > standard (not 64) so list all the versions of Deployment Target.
  • Bill Patterson
    Bill Patterson almost 11 years
    I've done this (using download link in an earlier answer), and the iOS 6.1 sdk choice does show up in xcode 5 under Build Settings > Architectures > Base SDK. However, when I build and run on iOS 7 simulator (or iOS 7 device) it's still using iOS 7 UIKit buttons (not iOS 6 versions). If anyone has any suggestions as to why, I'd be grateful....
  • Nick Hingston
    Nick Hingston almost 11 years
    Reasons not to - Xcode 5 is pretty unstable at the moment. Crashing hourly for me. Also some weird positional issues and colour issues in some views (though not lots of work to fix)
  • matt bezark
    matt bezark almost 11 years
    hi. this is close but not quite for me. the buttons look like iOS 6 but the view controller content still goes up behind the navigation bar when using a UINavigationController. any thoughts about how to get the iOS 6 behavior for that as well?
  • Rob Napier
    Rob Napier almost 11 years
    You can't get that. iOS 6 behavior is not available on iOS 7 (even for things built with iOS 6 originally). If it were, we wouldn't have had to all update our layouts to support ios 7. You'll have to make at least some ios7 calls to reconfigure the view controller. You should ask a new question if that's a problem.
  • Nirav Bhatt
    Nirav Bhatt almost 11 years
    Could you tell if this makes iOS 7 simulator show UI elements like it does in iOS 6.x (or whichever you copy SDK from)? My recent observation doesn't confirm this: stackoverflow.com/a/18948081/1506363
  • Rob Napier
    Rob Napier almost 11 years
    No; you'll only see this on the device. There is no iOS 6 compatibility mode in the iOS 7 simulator. If you want to see how it looks in the simulator, test on the iOS 6 simulator.
  • python
    python almost 11 years
    I did same but my GUI of app changes and it looks like iOS 7 GUI. I have choose iPhone Retina(4 inch 64-bit) simulator to run app. I am missing anything else after doing this.
  • Tony
    Tony almost 11 years
    This strategy doesn't seem to work for iOS 5 SDK. Any thoughts on why that might be the case?
  • Rob Napier
    Rob Napier almost 11 years
    I just tried this with an iOS 5 project and it seems to work. It even still seems to work with my 4.3 SDK. What problem are you seeing?
  • akaralar
    akaralar almost 11 years
    @RobNapier when i install more than one iphoneOS platform SDKs (7.0, 6.1, 5.1 etc) the device i plug in is shown with the same name in as many rows as there are installed SDKs in the device selection pane. do you have this problem? is there a way to distinguish between them?
  • Junfeng
    Junfeng almost 11 years
    Can I submit the app that is built with Xcode 5 and iOS 6 SDK to App Store?
  • Rob Napier
    Rob Napier almost 11 years
    Yes; you get multiple copies. They appear to be in order, however. I haven't had any trouble submitting to App Store, but Apple can decide their own rules at any time.
  • n13
    n13 over 10 years
    This is fantastic, thanks for your help. I downloaded XCode 4.6.3 from the developer website and just copied the iOS 6 SDK folder into XCode 5, worked first try.
  • Tony
    Tony over 10 years
    This must have happened since xcode 5 came out of beta and is now a general release. Good to know, thanks Smikey
  • ahwulf
    ahwulf over 10 years
    As long as the iPad 1 is still supported you can always assume Apple will accept 5.X iOS. It can't be upgraded.
  • avance
    avance over 10 years
    If you have TimeMachine installed you can open the above path (in terminal type:open "/Applications/Xcode.app/Contents/Developer/Platforms/iPhone‌​OS.platform/Develope‌​r/SDKs/" ) and restore the iOS6.1 SDK from there.
  • ohho
    ohho over 10 years
    Using 6.1 as the Base SDK, I cannot get the .xib to behave as it was compiled in Xcode 4.6: stackoverflow.com/questions/19509250/…?
  • oligofren
    oligofren over 10 years
    @Manni This is not the same as compiling against the old API. You are building using the new API for iOS 6.
  • Aniruddh
    Aniruddh over 10 years
    Yes, but iOS 6 SDK works well with iOS 7, too. Some apps are really pain to be switched.
  • Basil Bourque
    Basil Bourque over 10 years
    I believe you are incorrect. Apple is requiring (a) Built by latest Xcode 5, and (b) optimized for iOS 7. See my comment on Rob Napier’s answer for links.
  • user523234
    user523234 over 10 years
    @BasilBourque: ...if built in Xcode 5 using latest SDK: iOS 7 SDK
  • Rob Napier
    Rob Napier over 10 years
    @BasilBourque developer.apple.com/ios7 "Starting February 1, new apps and app updates submitted to the App Store must be built with Xcode 5 and iOS 7 SDK." I don't speak for Apple, and their actual criteria may be different. I'm just reading what they published.
  • karim
    karim over 10 years
    We can use this option to test our app, but probably after feb 2014, any app built with prior iOS 7 sdk will not be accepted in app store!
  • Wayne
    Wayne over 10 years
    Note that upgrading to 5.1 removed my 7.0.x SDK and replaced it with the 7.1 SDK. I have an old install of Xcode5-DP6 that I was able to recover 7.0.x from, but this is a good reminder to backup the SDK dirs (or rename the app entirely) before upgrading to or installing the latest Xcode version.
  • Kevin OMara
    Kevin OMara about 10 years
    Some of us develop for Enterprise distribution and need to target older SDKs (and devices). Enterprise apps do not go through the Apple Review process and/or App Store, and this discussion is quite useful, remains relevant, and will continue to be relevant into the future. I understand your perspective, but it is not the only one.
  • Andrea
    Andrea about 10 years
    You are totally right!!! I didn't thought about enterprise distribution. But don't forget that you can still deploy on iOS6 with the new Xcode just by setting the deployment target, without caring about ios7 optimization and review process.
  • chongzixin
    chongzixin almost 10 years
    this is relevant for users on XCode6 but still developing for iOS 6.1. Cheers!
  • GilesDMiddleton
    GilesDMiddleton over 9 years
    These options do not appear by default on Xcode 6 even if you've set an older target platform.