19

I've been wasting my whole day on this issue, and could not find a solution: I've been developing an application with iOS 6.1 SDK, and the whole design relies on the iOS 6.1 UI. Yesterday, I've updated my phone to iOS 7, and after the update finished, the previously deployed app, which came back from the backup looked and worked the same as before (on iOS 6.1); everything was fine. However, I had to update my Xcode to version 5, so I can continue deploying successive debug versions to my iOS 7 device during development. Before updating to Xcode 5, I've backed up the iPhoneOS6.1.sdk package from Xcode's internal folder; then updated to Xcode 5, and then placed the iPhoneOS6.1.sdk package back in its folder, next to the iOS 7 SDK, which came with the Xcode 5 installation. I've switched my project's base SDK to iOS 6.1, which did came up in the base SDK selector list, and made sure in the interface builder that all my storyboards/XIB's are set to build as iOS 6.1.

However, when I deploy the application to my phone, it looks like crap, as it's shown with iOS 7 UI elements. If I use a device with iOS 6.1 installed, everything looks fine; it looks like XCode doesn't give damn about my choice of base SDK, and links the application against iOS 7, if I choose to debug on an iOS 7 device.

How can I force Xcode, to deploy the same 6.1-linked stuff to all devices, regardless of it's installed iOS version?

Jano
  • 62,815
  • 21
  • 164
  • 192
Tamás Zahola
  • 9,271
  • 4
  • 34
  • 46
  • regarding your Xcode 5 crashes: they may be caused by plugins from Xcode 4. – zeiteisen Sep 19 '13 at 13:00
  • I didn't use any plugins in XCode 4. So unless it came with built-in plugins, which XCode 5 inherited on update, there aren't any pluging to interfere with XCode 5... – Tamás Zahola Sep 19 '13 at 14:06
  • If you are using standard controls then you can not make your iOS 6.1 app look like iOS 6.1 on iOS 7 device. To do that, you need to make custom UI controls using image overlays etc. – Yas Tabasam Sep 19 '13 at 14:47
  • 1
    Hi, My app crashed when I updated xcode to xcode 5 and sdk 7 and test it on iOS 7 device. but, if users download it from store on their iOS 7 devices it works with the 6.1 theme. What I am doing now is downloading the xcode 4. I will delete xcode 5 and install the old one with the old settings. and I will try to publish a version with few updates from my Xcode 4. – hasan Sep 19 '13 at 15:01
  • @YasKuraishi that's not true! Yesterday, I've built my .ipa using XCode 4.6, and it looks completely the same on iOS 7 as on iOS 6.1. I just cannot reproduce this using XCode 5... – Tamás Zahola Sep 19 '13 at 15:39
  • Did you manage to fix this issue? I have the same exact problem, if I link it against 6.1 it looks better than linking against 7.0, but still some elements are not correct (ie: navigation bars are trasparent) – ksn Oct 07 '13 at 09:20
  • Unfortunately not :( I had to dig through our projects and manually switch each navigation bar to translucent = NO. – Tamás Zahola Oct 07 '13 at 11:18

3 Answers3

12

Find and download old SDK. Older SDKs are found here, https://developer.apple.com/downloads/index.action?name=Xcode

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 I build from command line i 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. Add a symbolic link to the old SDK like this:

ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk iPhoneOS6.1.sdk
Jakub
  • 20,418
  • 8
  • 65
  • 92
karim
  • 15,408
  • 7
  • 58
  • 96
  • 1
    Yeah, that's what I've did in the first place, however in spite of building w/ iPhoneOS6.1.sdk, some UI elements' behaviour changed (although I've managed to fix them since then, as it was mainly an issue w/ UINavigationBars). – Tamás Zahola Sep 23 '13 at 13:26
  • 1
    yeah, transparent navigation bar creates the problem. – karim Sep 23 '13 at 13:44
7

In Xcode 5 toolbar, for your target you will see your device listed twice (you also mentioned this in your question ). For some weird reason one is building with iOS 6.x appearance and the other with iOS7 appearance. Trying building/running on one of the device from this list. If you still see the iOS7 appearance, click the stop in the toolbar, select the other device and build again.

I am not seeing any crashes in Xcode 5, so you may want to reinstall if it is crashing a lot for you.

bneely
  • 9,083
  • 4
  • 38
  • 46
rakmoh
  • 2,953
  • 1
  • 16
  • 14
  • Sorry, this doesn't work. But nice to see I'm not the only one struggling with duplicate devices. – Tamás Zahola Sep 19 '13 at 22:05
  • I started see iOS 7.0 UI appearance again on the iOS 7 device (even though I am building with iOS 6.1 sdk). Discovered something very weird. Can you please verify my updated answer? – rakmoh Sep 20 '13 at 03:37
  • 2
    Okay, that's weird. My phone is duplicated on the device list. If I choose the lower one, the application looks total crap (fully iOS 7). If I choose the upper one, the application looks less crap (mostly iOS 6.1), however some UI elements are still behaving like they do in iOS 7. For example navigation bars are semi-transparent, and the viewcontrollers view goes under the navigationbar, like in iOS 7. Looks like I'm having the same issue as this guy: http://stackoverflow.com/questions/18884272/is-it-possible-to-build-iphoneos6-1-projects-in-xcode-5-preserving-the-behaviou?rq=1 – Tamás Zahola Sep 20 '13 at 07:22
  • Fortunately all my views look ok. May be it is because I am not using storyboard in the app. However, it is making me uneasy and I think I am going to go back to 4.6.3 until I update my views for iOS7 UI guidelines/appearance. – rakmoh Sep 20 '13 at 13:28
  • Manually copying in the iOS 6.1 SDK used to work for me but now I am also seeing iOS7 UI elements instead. Any fix yet? – Imran Sep 24 '13 at 19:19
  • Just to add to @TamásZahola, it appears multiple devices appear because the 6.1 and 7.0 SDK are sitting side by side: http://stackoverflow.com/questions/19054395/xcode-5-shows-the-same-device-twice – John K. Chow Nov 08 '13 at 05:51
3

Firstly, you will need to copy and paste the iOS 6.1 SDK from a previous version of XCode. I believe other people have given instructions on how to do this.

Then, assuming you intend to continue development for iOS 6 (for example, without breaking the iOS 6 UI, and you don't intend to use new APIs), do this:

  • XCode should recognize 2 devices every time you plug in an iOS 7 device to your computer
  • Run the application on both of them (they are the same device actually, but one of them will be running the application iOS 6-style, and the other one will try to update it to iOS 7-style)
  • Remember the one running the app iOS 6-style (for me it's the topmost), and do Product > Archive on that device

This should keep on allowing you to build your applications with the iOS 6 style UI, at the same time allowing you to use Xcode 5. I would recommend starting a new development branch exclusively for UI changes to get your app's UI iOS 7 compatible.

Alex
  • 7,432
  • 20
  • 75
  • 118