How to use iOS Simulator 7 \ XCode 5 to test pre-i

2019-03-08 05:21发布

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.

13条回答
叛逆
2楼-- · 2019-03-08 05:58

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

查看更多
该账号已被封号
3楼-- · 2019-03-08 06:05

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.
查看更多
混吃等死
4楼-- · 2019-03-08 06:07

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)
查看更多
劳资没心,怎么记你
5楼-- · 2019-03-08 06:09

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.

查看更多
Bombasti
6楼-- · 2019-03-08 06:11

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.

查看更多
甜甜的少女心
7楼-- · 2019-03-08 06:16

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).

查看更多
登录 后发表回答