6

Our ios6.1-sdk-compiled app has been running fine on ios 6.1 iphone 4, 4s & 5 devices. When running the app on ios7 iphone 5s the user interface still looks like ios 6 (black buttons etc) but we're fine with most of it, except we found a bug. I'm guessing this is because changes on API implementation on ios7.

When our app is compiled against ios7-sdk on xcode 5 everything falls apart. UI objects are misaligned, label's can't be read etc. Hence we want to compile our code against ios6.1 sdk but run it on ios 7.

On Xcode 5 I've installed ios 6.1 sdk by copying it from Xcode 4.6.3 dmg as described on this post and updated Base SDK to ios 6.1 on build settings, however when running the app on ios 7 simulator the user interface wouldn't fall back to ios 6.1. It does however fall back to ios 6.1 if the app is tested against a physical iphone running ios 7.

How can I make ios 7 simulator falls back user interface when running ios6-sdk-compiled apps so we can reproduce the bug on simulator?

Community
  • 1
  • 1
gerrytan
  • 40,313
  • 9
  • 84
  • 99
  • I don't think that it is a the purpose of the simulator to mimic that functionality. I understand your way of thinking and I fell for it too, I wish I knew that iOS 7 had that fallback feature before I went and rush to get my code sorted for iOS 7. But I think if your app is still not iOS 7 ready, don't use the iOS 7 simulator use the older simulator (6.1) instead. In the end, the simulator is a simulator, not an emulator. It simulates your app for iOS 7 but it doesn't emulate the iOS 7 operating system. – Dandré Sep 30 '13 at 07:09

4 Answers4

4

If I understand your issue correctly... I have been running into the same problem with our app and needed to keep the iOS6.1 interface, built in Xcode 5 and running in iOS7. Our interface was also messed up, misaligned and toolbars missing buttons. We will fix it later for 7, but don't have time right now, but need it to run on iOS7 and be built in Xcode 5 still.

So here's what I did: (I'd like to post some screen shots, but don't have my mac handy, will get later if needed)

  • I kept Xcode 4.6.3 installed along with Xcode 5.
  • I added symlink from 6.1 SDK into the Xcode 5 installation. (I found a SO question on that, will find a link) Or you can install it like you did.

(these next 2 options may not be needed, but we ended up using them in testing, and it works, even the new 5S 64bit phone)

  • In Build Settings I selected build architectures to use the standard, non-64bit armv7 option, don't pick the "including 64bit" choice.

  • same place, Build Active Architecture Only to Yes

Then...

  • also in Build Settings, set Base SDK to iOS 6.1. (I believe this was the key to make it work)

  • General tab of app target, set Deployment Target to 6.1 (ours is still on 5.1, for now)

  • In our Storyboards, select File Inspector, in the Interface builder section I selected opens in Xcode 4.6, and Builds for iOS 5.1 and Later, and view as iOS 6.1 and Earlier. (my autolayout is unchecked, we don't use it)

Warning about that last option for "opens in". If you select "opens in Xcode 4.6", you will lose Storyboard editing for iOS7. In my case, I don't care for now, because I want it to stay in 4.6 views anyway. Just keep that in mind. I think you can switch it back, but haven't tested.

With the 6.1 SDK linked/installed, you should be able to select the desired iOS version for use in the simulator when you run in the the app. You will see it in the Active Schema drop down in the top toolbar. In my case, I can for example, select iPhone Retina (4-inch) and below that I have option for iOS7 or 6.1. The interesting part for me is, with the settings above, I am able run my app in the simulator and it looks like iOS6 even if I select iOS7 as the simulator active schema. It even worked in the 64bit simulator which, in my setup, will only show iOS7 selection.

At least this way I can build and work in Xcode 5, ad-hoc distribute the app for iOS7 users, but keep the iOS6 styles, placements and buttons intact. Now I can spend more time making the transition to iOS7 styles, but can still fix bugs and update the app as if it were iOS6.1.

I hope that makes sense, and I hope it answered your question. And I hope I remembered everything I did! I'll add more if I think of something.

gregthegeek
  • 1,353
  • 3
  • 14
  • 24
  • This doesn't seem to be working for me...the only thing I've done differently is copy the 6.1 SDK instead of the symlink. Anything else you can think of that you did? – steve Oct 02 '13 at 00:00
  • Not thinking of anything else right now, but I'll spend some time with another project that hasn't been run in Xcode 5 yet. Maybe I'll catch something else during the process. I'll try and get screen shots too. Might take me a few days to get to it though. Oh, there is one thing that probably doesn't matter but... On one of my view controllers I had several controls I was manually resizing in code. Because of the IOS7 size changes, it messed up the code I had. I took all that out and adjusted better in IB properties, then that particular view worked fine. – gregthegeek Oct 03 '13 at 22:38
4

Thanks all for the help but so far best workaround that allows me to reproduce the bug is to keep using xcode 4.6.3 and install ios 7 simulator into xcode 4.6.3.

I did so by installing both xcode 5 and 4.6.3 side by side (copy xcode.app into xcode4.6.3.app then install xcode 5 from app store (will overwrite xcode.app)), then symlink

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk

to

/Applications/Xcode4.6.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk

Make sure xcode isn't open when this is performed. If you already overwritten 4.6.3 to 5 you can download dmg of 4.6.3 from https://developer.apple.com/downloads.

Then I put:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app

(ie: xcode 5 version of the simulator app) on my dock

When testing the app, I had to manually launch the simulator from the dock first and select corresponding device version (go to Hardware -> Device -> select iphone 3.5"/4" - ios6/7) because xcode 4.6.3 wasn't able to automatically do this (presumably because of version difference / because I didn't symlink the xcode 5 simulator app to 4.6.3)

When launching, ensure 'iPhone 7.0 Simulator' is selected on xcode 4.6.3 Scheme. The ios6.1-sdk compiled app then falls back into ios 6.1 UI when run on ios 7 and I can reproduce my bug.

gerrytan
  • 40,313
  • 9
  • 84
  • 99
0

The appearance you describe is, I'm afraid, probably correct behavior for iOS 7. Table view content sizes are computed differently, for example (this will change the positions of many elements) as well as many other changes.

If you wish to retain your iOS 6 appearance, you will need to compile under Xcode 4.6, not 5. You can still run it under iOS 7, and in fact you can make an iOS 7 device show up for development by authorizing it in Xcode 5 and then switching back to Xcode 4.6.

I suggest you read Apple's iOS 7 Transition Guide, too, for advice about designing an iOS 7 compatible UI.

tooluser
  • 1,481
  • 15
  • 21
  • Yes my problem is not with how appearance still looks old, but the behavior of physical device is different with simulator. In physical device apps compiled with 6.1 sdk falls back to old appearance while in simulator it's being displayed in new look and feel – gerrytan Sep 24 '13 at 22:31
  • This is a property of XCode 5 AFAIK. If you want the old look, you have to develop with the old tools - and if you want the new tools, you're forced to upgrade. Sorry, probably not the answer you want - but it's the only answer without crazy symlink hacking. Edit: Which I see someone has detailed! – tooluser Sep 30 '13 at 00:07
0

Try "reset content and settings" in the simulator, and make sure that you are using the correct simulator and SDK for your scheme in XCode when you build & run. If you install the iOS 6.1 SDK as you describe, you should see what appear at first glance to be duplicates in the list of simulators available for your target scheme - one of those WILL give you the desired behavior (most likely "iOS 7.0 | iOS 7.0 SDK", but not always it seems). Make sure your deployment target is set to 6.1 or earlier as well, and your base SDK to 6.1 (as you describe)

quellish
  • 21,123
  • 4
  • 76
  • 83
  • Thanks I've done all that but I still can't get ios 7 simulator to fall back to ios 6 look and feel – gerrytan Sep 25 '13 at 23:55