35

I have Xcode 6 installed but realise that I am only able to develop for iOS8. I am aware that this beta development kit is meant for the development of the iOS 8 beta release but I am in a position where I don't have the time yet to develop for it but wish to take advantage of some of Xcode's new features while I am developing for my current iOS 7 apps.

What can I do to get the iOS 7 SDK installed on xcode 6?

Pavan
  • 17,840
  • 8
  • 59
  • 100

5 Answers5

34

Seems like if you symlink the relevant SDK from a previous installation of Xcode to the Xcode 6 Beta directory, Xcode 6 will be able to use it. Assuming you still have Xcode 5.1.1 on your machine, try the following in terminal:

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk

This should link the iOS 7 SDK for iPhone (not sim), allowing you to select iOS 7 as the Base SDK in Xcode 6 Beta. If you want to do this for the simulator, replace iPhoneOS.platform with iPhoneSimulator.platform.

NOTE: Just because you have the iOS 7 SDK now doesn't mean it'll build. I'm personally having trouble with the fact that Xcode 6 Beta is using the Apple LLVM 6.0 compiler, which apparently isn't compatible with some of the stuff I'm trying to build.

ref: https://stackoverflow.com/a/11424966/2383003

the_storyteller
  • 2,335
  • 1
  • 26
  • 37
Ziewvater
  • 1,413
  • 1
  • 18
  • 33
  • 1
    Is it possible to get the Xcode 6 Beta to use Apple LLVM 5.1? – ankushg Jun 23 '14 at 23:36
  • I don't know, that's exactly the issue I tried to solve for myself, but wasn't able to find a way to do it. I'm not familiar with compilers at all, so I was basically just feeling around in the dark. If you find a way to get it to work, please let me know. – Ziewvater Jun 24 '14 at 20:17
  • Note, the latest Xcode6 (GM) is called just plain "Xcode" and therefore tries to overwrite the existing "Xcode" (5), but if you keep them both, and name the former "Xcode 6" the command line changes to the following: `ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk /Applications/Xcode\ 6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk`. – Hari Honor Sep 18 '14 at 14:29
  • 1
    Also worth noting for those who haven't fully grocked it yet: if you build for the iOS7 *SDK* (i.e., as well as "deployment target") then a device running iOS8 will use the older framework and run (nearly) identically to one which hasn't upgraded yet. So if you don't need any iOS8 features, I believe you're safe sticking with the older SDK. – Hari Honor Sep 18 '14 at 14:30
  • 6
    What's strange is the fact that after adding the symbolic link to my Xcode folder, I see my device twice with the exact name and with some infos (iOS build number, model, device identifier) in the target selector in the upper left corner of Xcode. Depending on which of the both entries I chose, my app works fine or not, no matter which BASE SDK I chose. ??! Anybody experiencing the same? – Christian Sep 22 '14 at 10:35
  • @Christian Wow! You're spot on! Looks like XCode is overriding the base SDK based on which "device" you pick! – Benjamin Dobell Sep 26 '14 at 13:06
  • 2
    Apple is pushing for use of iOS 8 SDK only: https://developer.apple.com/news/?id=10202014a – Carl Oct 21 '14 at 13:43
  • 2
    This technique still works for using the Xcode 8.x SDK in Xcode7. – Kyle Robson Sep 14 '15 at 20:56
3

Just posting so that someone might find it useful: I wanted to debug my app in iPhone running iOS 7.1, in XCode 6.0.1. The previous iOS version was not being listed in the settings page, to choose as base SDK/deployment target. (I'm using OS X 10.10 Yosemite). I installed both XCode 6.0.1 and Xcode 5.0.1 and copied

/Application/XCode501.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk

to

/Application/XCode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

Now I'm able to run iOS 7 apps from XCode 6.0.1.

Axel Guilmin
  • 11,454
  • 9
  • 54
  • 64
Joe M
  • 669
  • 6
  • 9
2

I changed the deployment target just fine and installed on my iOS7 iPhone 4s all the same. You can do all your development this way and then use 5.1.1 to make your relevant builds. I wouldn't advice to build apps for production in this beta environment even if you could.

Fernando Mazzon
  • 3,562
  • 1
  • 19
  • 21
  • I simply changed my development target to iOS 7.0 and it worked. +1 – Luc Jul 29 '14 at 23:59
  • 10
    Deployment target doesn't change which version of the SDK the project is built with. It is the "base SDK" setting that determines the build SDK. For Xcode 6 only iOS 8 is available by default. – ThomasW Aug 18 '14 at 09:35
  • I know, my answer was more in response to the content "I have Xcode 6 installed but realise that I am only able to develop for iOS8." than the title, which is his real problem. There is no good reason to build using an older SDK even if he could. – Fernando Mazzon Nov 17 '14 at 17:25
2

Just repeating Christian's comment (on Ziewvater's answer) so it's more prominent:

What's strange is the fact that after adding the symbolic link to my Xcode folder, I see my device twice with the exact name and with some infos (iOS build number, model, device identifier) in the target selector in the upper left corner of Xcode. Depending on which of the both entries I chose, my app works fine or not, no matter which BASE SDK I chose. ??! Anybody experiencing the same?

This is exactly my experience also! Me and my team were tearing our hair out trying to understand why some builds seemed to be working and others were not.

It looks like Apple must be ignoring the base SDK (or target... or something) when you pick the wrong device from the list.

Benjamin Dobell
  • 4,042
  • 1
  • 32
  • 44
  • I see the same thing. One of the device "duplicates" runs as tho is was built with iOS7 but the other runs like it was built with iOS8 (as do my simulators). – moliveira Oct 07 '14 at 03:01
  • Any solution for this problem? – Morten Holmgaard Nov 11 '14 at 08:10
  • @MortenHolmgaard The solution is to pick the correct (in my case first) device in XCode. If you're using a third-party tool like AppCode, which only shows the "incorrect" device, then you're out of luck. – Benjamin Dobell Nov 12 '14 at 13:02
0

in Xcode 6.1.1 (Window -> Preferences - Downloads) you can install iOS 7.1 simulator. unfortunately it doesn't install iOS 7.1 SKD. if you set deployment target to 7.1 all builds without any trouble. be worry!!!! it is up to you to check the compatibility with 7.1 (SDK is still 8.1). so or so, all runtime trouble should be seen in simulator. i use this approach to build for my iPhone 4 in swift, where iOS 7.1.2 is the last available. (simply don't use any classes available only for newer devices :-))

user3441734
  • 16,722
  • 2
  • 40
  • 59