194

Xcode 6 GM now includes simulators for iPhone 6 and 6 Plus, and by default they run apps in a scaled mode.

To enable the new screen size I tried adding Default-667h@2x.png which seems to do a part of the trick since the app now fails to run at all, with the error "Unable to run app in Simulator – An error was encountered while running (Domain = LaunchServicesError, Code = 0)".

Has anyone figured out how to get an app actually run in the 6/6+ resolution?

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
villapossu
  • 2,737
  • 4
  • 18
  • 19
  • 16
    As others have said, the trick is to add a launch image of the right size to your project. I wrote up a quick guide of [how to add a launch image so that you can display iPhone 6 resolution](http://matthewpalmer.net/blog/2014/09/10/iphone-6-plus-launch-image-adaptive-mode/) here. – matthewpalmer Sep 10 '14 at 06:28
  • 1
    this worked for me http://stackoverflow.com/questions/25755443/iphone-6-plus-resolution-confusion-xcode-or-apples-website-for-development – johndpope Sep 22 '14 at 06:54
  • 2
    The naming of images is different for iphone 6/6+. For me just adding the launch image for 6 and 6+ worked perfectly. Look at this answer for the correct naming convention: http://stackoverflow.com/a/27473877/1568532 – fellowworldcitizen Jan 16 '15 at 02:18
  • Is there any alternative instead of using LaunchScreen? – Vaibhav Jhaveri Feb 03 '15 at 10:02

8 Answers8

218

You can add a launch screen file that appears to work for multiple screen sizes. I just added the MainStoryboard as a launch screen file and that stopped the app from scaling. I think I will need to add a permanent launch screen later, but that got the native resolution up and working quickly. In Xcode, go to your target, general and add the launch screen file there.

Launch Screen File

David L
  • 4,347
  • 3
  • 18
  • 30
  • 2
    This is probably the best solution if you are using a single storyboard that handles all devices. My answer is appropriate if you are not using a single storyboard or you need separate, explicit launch images. – rmaddy Sep 10 '14 at 00:36
  • I need to set explicit launch images for iPhone 6 and 6 Plus, is there a naming convention if I don't want to use asset catalog? – Radif Sharafullin Sep 10 '14 at 19:22
  • @Radif Sharafullin There are some instructions here on how to name the launch images: https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW12. Scroll all the way to the bottom for launch image naming pattern. – David L Sep 11 '14 at 01:31
  • I had luck by adding a "UILaunchStoryboardName" entry to info.plist. It even worked from an Xcode 5.1 build. – Walt Sellers Sep 23 '14 at 22:19
  • 6
    Keep in mind that once you migrate to `LaunchImage`, iOS will no longer stretch your iPhone-5 app to iPhone-6 (and 6+). Which can break your App's UI if you are making your views with absolute size like 320px in width and not using relative size using autolayouts. – atulkhatri Dec 31 '14 at 06:07
  • atulkhatri, I have found that to happen! Anyway to fix this? – bobo2000 Mar 08 '15 at 19:22
  • 2
    @bobo2000 design responsively. – mattsven Apr 23 '15 at 11:05
  • OMG you're genius. You saved my whole night – Tung Vu Duc Jun 26 '19 at 20:06
116

If you are using asset catalogs, go to the LaunchImages asset catalog and add the new launch images for the two new iPhones. You may need to right-click and choose "Add New Launch Image" to see a place to add the new images.

The iPhone 6 (Retina HD 4.7) requires a portrait launch image of 750 x 1334.

The iPhone 6 Plus (Retina HD 5.5) requires both portrait and landscape images sized as 1242 x 2208 and 2208 x 1242 respectively.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • 2
    Wish I could choose two right answers since this seems all very correct. Haven't yet started using asset catalogs (well, just tried unsuccessfully to adopt one — somehow the app didn't find the launch images there) but assigning the launch screen file was an easy fix here. – villapossu Sep 10 '14 at 00:42
  • It should be possible to add the right launch images without using asset catalogs. But I don't know offhand how to reference them in the Info.plist. – rmaddy Sep 10 '14 at 00:44
  • Do I need to actually add an image? I turned these on and it's still scaling. – Epic Byte Sep 21 '14 at 03:47
  • Yes, you must actually add the images (or use the new "Launch Screen File" (but that's only for iOS 8). – rmaddy Sep 21 '14 at 04:27
  • Does anyone here know why the 6 plus image's resolution needs to be larger than the actual resolution of the device itself? And also why the 6 plus requires both a portrait and landscape, but the 6 doesn't require but the portrait? – trumpetlicks Sep 30 '14 at 20:25
  • 1
    @trumpetlicks The plus renders to a larger target and then scales down the render to the actual screen size, same technique as the retina MacBook Pro's. Also, the Plus can actually launch apps in landscape, no other iPhone can – hokiewalrus Sep 30 '14 at 20:37
  • I tried this, and it didn't work: http://stackoverflow.com/questions/43199231/is-it-okay-to-leave-out-unnecessary-launch-images Any idea why? Thanks. – Kartick Vaddadi Apr 04 '17 at 05:56
103

I've made basic black launch screens that will make the app scale properly on the iPhone 6 and iPhone 6+:

iPhone 6 Portrait

iPhone 6 Plus Portrait

If you already have a LaunchImage in your .xcassett, open it, switch to the third tab in the right menu in Xcode and tick the iOS 8.0 iPhone images to add them to the existing set. Then drag the images over:

enter image description here

Andrew
  • 15,357
  • 6
  • 66
  • 101
A.Badger
  • 4,279
  • 1
  • 26
  • 18
52

I didn't want to introduce an asset catalog.

Per the answer from seahorseseaeo here, adding the following to info.plist worked for me. (I edited it as a "source code".) I then named the images Default-667h@2x.png and Default-736h@3x.png

<key>UILaunchImages</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{375, 667}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{414, 736}</string>
    </dict>
</array>
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
  • This answer is great. It allows using the images easily to transition from the splash screen to the app. No other solution (asset catalog or story board) allows this to be done as easily. – jjxtra Sep 13 '14 at 20:49
  • 7
    Worked for me (thanks!) but it stopped recognizing the 568h@2x launch image, deactivating the iphone 5 size support. I just had to add another item similar to the two above but specifying 568h. (specific fields: `Default-568h`, `{320, 568}`) – Steph Thirion Sep 18 '14 at 02:54
  • The same applies to the iPhone 4S. – Josh Bernfeld Sep 25 '14 at 18:22
  • 1
    just made the experience (on the simulator) that the specified image files don't even need to exist. – glasz Sep 28 '14 at 13:05
  • I have a problem with this technique on iPhone 6: it shows first the startup screen Default-667h@2x.png and then briefly shows Default-Portrait@2x~iphone.png. Any idea? – Samuel Oct 01 '14 at 10:52
  • how do you "ADD" this to your plist? not sure how that's done? can someone explain? – 4GetFullOf Oct 06 '14 at 23:44
  • To support iPhone 5 4inch screen, just add the following UILaunchImageMinimumOSVersion 7.0 UILaunchImageName Default-568h UILaunchImageOrientation Portrait UILaunchImageSize {320, 568} – Vince Yuan Jan 27 '15 at 14:29
  • did you need to add iPads as well for universal support? – Jef Feb 28 '15 at 20:13
  • Works perfect for me. Just a tinsy, tiny advice: the space in `{414, 736}` is important. If you don't put it, it won't work. – Cyrille May 19 '15 at 14:36
  • walapu is correct. You need this for 4s under ioS 8: UILaunchImageMinimumOSVersion 8.0 UILaunchImageName Default UILaunchImageOrientation Portrait UILaunchImageSize {320, 480} – Christopher Schardt May 20 '15 at 04:25
  • To support startup in landscape on an iPhone 6+, I added this: UILaunchImageMinimumOSVersion 8.0 UILaunchImageName Default-414h UILaunchImageOrientation Landscape UILaunchImageSize {736, 414} In the 6+ simulator, only a black screen in shown. Does anyone know how to get landscape 6+ launch images working without asset catalogs? – Christopher Schardt May 20 '15 at 05:04
21

Note that iPhone 6 will use the 320pt (640px) resolution if you have enabled the 'Display Zoom' in iPhone > Settings > Display & Brightness > View.

tomi44g
  • 3,266
  • 1
  • 20
  • 28
8

Do the following (see in photo)

  1. Goto asset catalog
  2. right-click and choose "Add New Launch Image"

    • iPhone 6 -> 750 x 1334
    • iPhone 6 Plus -> 1242 x 2208 and 2208 x 1242

enter image description here

Umar Farooq
  • 735
  • 1
  • 10
  • 19
3

An error was encountered while running (Domain = LaunchServicesError, Code = 0)

Usually this indicates that installd returned an error during the install process (bad resources or similar).

Unfortunately, Xcode does not display the actual underlying error (feel free to file dupes of this known bug).

You should check ~/Library/Logs/CoreSimulator/CoreSimulator.log which will log the underlying error for you.

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
  • Thanks! Wasn't aware of this extra insight into the root cause of the error. The detailed log doesn't say that much to me but at least I have something to attach to my radar filing. – villapossu Sep 11 '14 at 14:41
0

If you are using asset catalog, and have multiple targets both using same asset catalog file, be sure that this file has checked both targets in the right panel in xcode.

That was my problem.

enter image description here

luky
  • 2,263
  • 3
  • 22
  • 40