30

Compiling my app on XCode 4.6.3 and running it on iOS 7 works great.

Compiling my app on XCode 5 and running it on iOS 7 results a big UI mess I don't want to handle right now. (iOS 7 pickers, tabbars, tableviews etc')

Goal:

I want to be able to use XCode 5 and test my app on the iOS 7 simulator but still use the iOS 6 and lower UI and feel.

Reason:

I don't want to redesign my app to iOS 7 but I do want to make sure it runs fine on iOS 7 using XCode 5 iOS 7 simulator.

Is there a quick toggle on XCode 5 to force everything to stay the same?

Is doing something like using iOS 6 Base SDK in XCode 5 acceptable or a bit too much hacky?

Edit:

Using iOS 6 SDK doesn't help. You'll still get the iOS 7 look on your app, just more buggy.

Community
  • 1
  • 1
Segev
  • 19,035
  • 12
  • 80
  • 152

13 Answers13

16

This is the scenario:

  • Your app works fine on iOS 6 and lower
  • You want to test your app on iOS 7
  • If you have iOS 7 on your device you'll need XCode 5 in order to test it on it
  • If you want to test it on the iOS 7 simulator you'll need to install XCode 5 for it
  • Compiling your working app on XCode 5 will break all hell loose and will force you to redesign your app at least for iOS 7
  • The solutions suggested here so far will help you to see how your app will look like on iOS 7 but will not keep your iOS 6 and lower look on iOS 7.

Best solution I've found so far:

  1. Update your current XCode to XCode 5
  2. Download XCode 4.6.3 from here
  3. Install it in a different location and Change the name of the app to XCode4 in order to differentiate between the two.
  4. Find your XCode 5 app icon, right click it and select "Show Package Contents"
  5. Locate the folder MacOS and move the xcode file outside of its folder. Those last two steps are to prevent you accidentally opening a project with XCode 5. An alternative is to change the default "Open With" app but for some reason that didn't work for me plus I wanted to be extra sure after I had one project opening with XCode 5 and the StoryBoard changed to be compatible to XCode 5 only. *
  6. Open XCode 4.6.3 and run your project. In your simulator menu you should now See iOS 7. Even if in XCode top bar you'll see AppName->iPhone 6.1 Simulator , selecting iOS 7 on the simulator will run your app in iOS 7 and keep everything the same.

After the above you'll have two versions of iOS simulator. Version 6 and version 7 that contains iOS 7 Simulator.

Step 5:

enter image description here

Segev
  • 19,035
  • 12
  • 80
  • 152
  • +1 this works. I still don't get why targetting iOS 6 SDK does not make it look like iOS 6. At the same time they have kept pre-iOS 7 compatibility mode alive. – Nirav Bhatt Sep 23 '13 at 08:33
  • Good luck - what I observe is that it keeps most of the stuff intact like pre-iOS 7. Only OS-specific stuff like alerts pertains to iOS 7. – Nirav Bhatt Sep 23 '13 at 08:53
  • There's no way to show iOS 6 alerts on iOS 7 without customising it for your needs. Doesn't really bother me really. The above solution works for everything else, pickers, tableviews, tabbar (its white now!) statusbar location etc'. – Segev Sep 23 '13 at 09:40
  • Is this also a way to test pre-iOS 7 interface on iOS 7 device? Or only on iOS 7 simulator? Thanks – Thermometer Sep 25 '13 at 11:20
  • I had a slow slow iOS 7 on my iPhone 4 for one day before restoring back to iOS 6.1.2 so I can't really help you there. In general though, for XCode to recognize your iOS7 device you need a XCode version that knows about iOS 7 ( XCode 5 and up). – Segev Sep 25 '13 at 12:02
  • It is possible to deploy to an iOS7 device using Xcode 4.6, it requires some trickery. You need to run first something from Xcode 5, and it will then appear as a viable target in Xcode 4.6 – Léo Natan Sep 26 '13 at 06:15
  • @LeoNatan Sounds very interesting! I'll defiantly check that out. From your comment I understand that XCode 4 & 5 should run at the same time? – Segev Sep 26 '13 at 06:18
  • 1
    It's very annoying that Apple puts these artificial blocks. It's obvious why they do it (they want people to update to the latest SDK), but still very annoying and unnecessary. – Léo Natan Sep 26 '13 at 06:19
  • I have the two versions of Xcode, but when I run the app in the 6.1 simulator (from 4.6.3), the 7.0 simulator does not show up in either the Hardware menu in the Simulator app or the AppName > Simulator list in Xcode. Any ideas? – Mackey18 Oct 04 '13 at 12:44
  • @Mackey18 Close the simulator window. Go to XCode 5 app, right click on it and select "Show Package Contents" Then navigate to `Contents->Applications` and start `iPhone Simulator` which is iPhone Simulator V7. Now when you'll run your project from Xcode it will run in the simulator you just opened and on iOS 7. Make sure you drag that Simulator to your dock to make it easier on future use. – Segev Oct 04 '13 at 13:11
  • ^ Just to make the above a bit clearer, XCode will run your project on the Simulator app that runs in the background Regardless of the iOS version you select in the XCode menu before running, – Segev Oct 04 '13 at 13:29
  • Hmm, I've tried this, but when it runs it doesn't show up in the simulator. Xcode says it's running but the Simulator remains unchanged. – Mackey18 Oct 04 '13 at 13:34
  • Does this work on Mavericks for you guys? Xcode 4.6.3 crashes on me as soon as I let it run in the standard 6.1 Simulator (from the Xcode 4.6 package). If only the Simulator from Xcode 5 is open, it launches the Xcode 4.6.3 Simulator then complains that only one Simulator can be open at the same time. – Ortwin Gentz Oct 24 '13 at 20:00
  • @OrtwinGentz Works fine on Mavericks – Segev Jan 06 '14 at 08:37
5

COPY iPhoneSimulator6.1.sdk

FROM

<YOUR XCode4 path>/Xcode4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/

TO

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

and set your base target to iOS6.1 (It will be listed after copying/pasting from xcode4) and

enter image description here enter image description here

palaniraja
  • 10,432
  • 5
  • 43
  • 76
4

You cannot do this on the iOS 7 Simulator. You can do it in the iOS 6 Simulator (running under Xcode 5) and on the device (running iOS 7 as long as you build with the iOS 6 SDK). But there is no iOS 6 compatibility mode in the iOS 7 Simulator.

Note that iOS 6 compatibility mode is not a perfect replication of iOS 6. There are still various behavioral differences that you will likely have to test for and deal with. But the basic UI components are what you expect.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610
3

EDIT - Note that it is not possible to force an app to use the iOS 6 interface on an iOS 7 device using Xcode 5 (unless you make custom graphics). It is also not a good design approach. Users on iOS 7 expect a certain UI style, that's why they updated; so give it to them, don't force them back into an older interface.

If you really, really need the pre-iOS-7 interface, you can download a copy of Xcode 4 and build with that. However, starting February 1, 2014 Apple will stop accepting apps built with anything earlier than Xcode 5.0 (I think I saw something about that in the iOS 7 dev docs, but can't find the reference again).


Keeping the iOS 6 UI in your app, but building for iOS 7 is fairly straightforward. Make sure that you've set your Deployment Target as iOS 6.1 or earlier. Your Base SDK can still be set as iOS 7 though. Now, just follow the instructions below for each of your interface files:

  1. Open your storyboard file or XIB file
  2. Open the Utilities Panel on the right side.
  3. Click on The File Inspector Tab. You should now see something like this:

    Xcode 5 Utilities Panel and File Inspector

  4. Next go to the Interface Build Document Section and change the Builds For setting to iOS 6.0 and Later or whatever version you need.

    Xcode 5 Utilities Panel Interface Build Document Section

  5. Then change the View As setting to iOS 6.1 or earlier:

    Xcode 5 Interface Build Document Section - View As Setting

  6. Xcode will prompt you, just confirm that you want to convert to the older UI.

Make sure to run your project in the iOS 6 Simulator. Otherwise, the iOS 7 Simulator will override it's own iOS 7 UI style. To download the iOS 6 Simulator, go to the Xcode Menu Bar. Select Xcode, Preferences. Then click on the Downloads tab. Finally, click on the Simulator(s) you need to download:

enter image description here

Then Run your app on the iOS 6 simulator: enter image description here

Unfortunately, even disabling the iOS 7 UI in Xcode does not override it on the device / simulator. Unless you design custom UI elements, there isn't a way to maintain your iOS 6 UI on iOS 7. But as I showed you, you can continue to edit it in iOS 6 and build for iOS 6.

Sam Spencer
  • 8,492
  • 12
  • 76
  • 133
  • I've followed your steps and it doesn't seem to work for me. When run on device the UI is still using the new iOS 7 style. – lxt Sep 22 '13 at 21:01
  • @lxt I've updated my answer. The solution should now work. Please consider "un-downvoting" – Sam Spencer Sep 22 '13 at 23:50
  • I'd love to test it out but the app in question doesn't use xib files or Storyboard - Pure code only. I'm still interested in your answer for other projects i'm maintaing and will test it out soon. – Segev Sep 23 '13 at 05:24
  • @RazorSharp Thanks for your help but this doesn't work for me too. This will only give you a preview of how the app will look like in iOS 6. The look will still be iOS7ish and all the UI will change. – Segev Sep 23 '13 at 12:36
  • I can imagine that the down vote was due to you being incorrect: if you use an older SDK (6.1 instead of "latest" 7.0) you will very much be able to get the iOS 6 look and feel on iOS 7 devices. iOS 7 does this for all apps that have not yet been compiled with the iOS 7.0 SDK. By installing an older SDK you have a choice which one to use for compiling in Xcode. So it IS possible to retain legacy look on iOS 7 devices. See here: http://pinkstone.co.uk/how-to-use-ios-6-legacy-look-in-xcode-5/ Note though that from the 1st of Feb 2014 Apple no longer accepts such submissions. – Jay Versluis Jan 05 '14 at 13:29
1

Linking the 6.1 SDK into Xcode 5 as described in the other answers is one step. However this still doesn't solve the problem that running on iOS 7 new UI elements are taken, view controllers are made full-size etc.

As described in this answer it is also required to switch the UI into legacy mode on iOS 7:

// put in main.m
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"UIUseLegacyUI"];
[[NSUserDefaults standardUserDefaults] synchronize];

Beware: This is an undocumented key and not recommended for App Store builds!

Also there are subtle differences to a version built using Xcode 4.6. For instance, transparent navigation bars behave differently (causing the view to be full-size).

However, since Xcode 4.6.3 crashes on Mavericks (at least for me, see rdar://15318883), this is at least a solution to continue using Xcode 5 for debugging.

Update: the crash of Xcode 4.6.3 on Mavericks only occurs when using LLDB. When switching back to GDB it works.

Community
  • 1
  • 1
Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213
0

Contrary to my comments, I could actually follow the steps mentioned in the link. What I tried was nothing sort of hacky:

  • Open XCode 4.6 app package (I have it still installed)
  • Go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs folder.
  • Copy iPhoneOS6.1.sdk folder.
  • Open XCode 5 app package.
  • Go to same Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs folder.
  • Paste.

I could then see iOS 6.1 as an option to base off my iOS project under Build Settings->Base SDKs.

However, even after doing this when I ran the app under iOS 7 simulator, I could sense no visual difference - all was rendered in default iOS 7 style - borderless buttons and bars.

No change after resetting simulator.

No change after changing storyboard version too.

So this again seems to confirm my assertion that this isn't possible.

If anyone tried it, I want to know.

Community
  • 1
  • 1
Nirav Bhatt
  • 6,940
  • 5
  • 45
  • 89
0

I think that the only way to show iOS 6 controls on XCode 5 (and iOS7 Simulator) is to set the Base SDK of your Target to iOS 6.1(6.0).

You should copy the old sdk to XCode 5 like Nirav described and restart the XCode to make it visible under Base SDK selection.

My guess is that it didn't work for Nirav because he changed the settings of the project and in his case they have been dis-synchronized from settings of the target. So make sure that Base SDK for your target is iOS 6.0. Then it should work (at least it does for me).

Andris Zalitis
  • 2,369
  • 18
  • 18
0

This will give you a preview of how the app will look in iOS 6 using Xcode 5.

I saw this on a WWDC Video.

406 - taking control autolayout xcode 5 (about 32 mins in)

Using, the preview function within the storyboard.

enter image description here

This will allow you to pick between how it will look on iOS 7 and iOS 6.

enter image description here

The video shows a cool (almost hidden) feature of xcode that allows you to see, both previews of iOS6 and iOS7 at the same time, splitting up Xcode into 3 separate views

DogCoffee
  • 19,820
  • 10
  • 87
  • 120
  • Although that's a nice feature, that doesn't answer the question. I don't need a preview of how the app will look like in iOS 6. I want it to look like it looked before iOS 7 and still use XCode 5. – Segev Sep 23 '13 at 05:22
  • Yeah I understand, though this would be better than nothing. I hated iOS7, but growing to enjoy the flexibility it offers. – DogCoffee Sep 23 '13 at 09:07
0

I'd like to add that while you may not be able to do it in the simulator, you can run your apps in compatibility mode on an actual device that has iOS 7.

Matthew Quiros
  • 13,385
  • 12
  • 87
  • 132
0

Wow, this is a real mess. Thanks, Apple [*]

I got this (this: XCode 5 building iOS 6 apps) working for me, but I had several XIB's that were messed up, and it took a combination of several of the above steps to get it working.

1) Setup XCode 5 with iOS 6 base sdk

@Sha has good steps for that: How to use iOS Simulator 7 \ XCode 5 to test pre-iOS 7 UI (without upgrading the app for iOS 7)

2) Go through each XIB and set it for XCode 4.6 mode

@RazorSharps post has good steps: How to use iOS Simulator 7 \ XCode 5 to test pre-iOS 7 UI (without upgrading the app for iOS 7)

I'm not sure this was 100% required, but I did it and it works. (Perhaps I'll go back later and try without this, when I'm not still fuming).

3) Find any Navigation Controllers in XIB (or code) that may be set to Translucent, set them to Opaque

This was the trick for me. I had a root XIB that defined the Navigation Bar as Black Translucent, but all the XIB's that loaded overrode with their own appearance.
In 'real iOS 6' the controllers setting would override this (that is, the navbar would appear as opaque), but in iOS 6 Compatibility Mode on iOS 7 it wouldn't (that is, it would have an iOS 6 appearance, but be transparent, and mess up view layout).

    • @appledevtools: We appreciate your hard work, this is tough to get right. But here's a suggestion: When upgrading an existing project to XCode 5, IB xib's should be left in XCode 4.6 mode. Let the Editor > Validate Settings code offer to upgrade the settings, with a reasonable warning of the implications. Don't do this automatically & silently :-) Also, please find & fix why the navbar style changed in iOS 6 compatibility mode.
Community
  • 1
  • 1
Davidm
  • 186
  • 1
  • 4
0

Good news is that we can set the base sdk to iOS 6.1 with XCode 5 now(in my case, it's Version 5.0.1 (5A2053)), and test & debug our pre-iOS7 designed app on iOS 7 simulator now.

For those who don't know how to set base sdk to iOS 6.1 for XCode, this link might be a guide.

Everything seems to work fine, the same pre-iOS7 design look & feel, except some os provided controls like ActionSheet look & behavior in the iOS 7 way.

BTW, I've upgrade my mac os to maverick yesterday, not sure whether this is an affect factor.

Community
  • 1
  • 1
David
  • 3,843
  • 33
  • 36
  • Whoever undervotes this post please at least give some comment. The method tried here is experienced by myself and everything turns out to be what it was said. – David Nov 07 '13 at 23:51
0

This worked for me but the explanation here needs cleaning up and detailing. If still desired, let me know and I will go into more detail.

It follows on from this answer

  • In addition to copying the iPhoneOS6.1.sdk folder, you also need to download the iOS 6.1 simulator (the proper way or copy it from an older installation of Xcode)
  • Then, make a duplicate of the iOS 7 simulator and replace it's plist with the 6.1 simulator's plist
  • Restart Xcode
  • You will then see two iOS 7 simulator options for each device option. One will be the normal iOS 7 simulator. The other will run your 6.1 SDK builds on the 7 simulator
  • WARNING You may not be able to remove the dummy simulator from Xcode's drop-down list afterwards (I haven't tried. It stuck around after I removed the dummy simulator folder)
Community
  • 1
  • 1
iosengineer
  • 186
  • 5
-1

Set deployment target to iOS 7.0 from deployment info. For that tap on project name and on first screen you will see deployment info... Change deployment target to 7.0. After that quit simulator, build and run app again.

Adnan Aftab
  • 14,377
  • 4
  • 45
  • 54
  • I don't really understand how that changes anything. – Segev Sep 22 '13 at 18:42
  • You want to run iOS 6 build in iOS 7 without using iOS 7 sdk... this is the way... I don't understand why you minus my answer. – Adnan Aftab Sep 22 '13 at 21:08
  • No, you should set your deploy target to at most iOS 6.0. If you set it to iOS 7.0 and you didn't apply autolayout to your app UI, you'll get a UI mess. – David Nov 07 '13 at 23:57