Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy project with iOS base SDK 6.1 to device with iOS 7

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?

like image 752
Tamás Zahola Avatar asked Sep 19 '13 12:09

Tamás Zahola


2 Answers

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
like image 116
karim Avatar answered Oct 16 '22 14:10

karim


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.

like image 43
rakmoh Avatar answered Oct 16 '22 13:10

rakmoh