Debug on iOS device gives wrong screen size - ios

I'm trying to run my application on an iPod 5 (4inch retina screen) but it shows the 3,5 inch version of the application.
On an iPhone 5S it does show the correct screen size. Are there any known settings to accomplish a setup like this and how can I turn it off again?

You need to make sure that you have all the images set in the LaunchImages.
You can find this in the images.xcassets of your project in xcode.

Apparently you also have to assign the Image asset to the project. In your target you see the asset to choose from in the 'app icon and launch images' section, here it pointed to an old & renamed asset.
Changed it to the correct one, removed the derived data and it worked.

Related

Xcode Launch Image for iPhone 6 landscape...?

My app is landscape only, and I'm trying to add launch images, but I don't see anywhere in the Launch Image assets a placeholder to drag the image for "Retina HD 4.7" Landscape.
Please advise.
I had this issue on one of my apps that I started developing and then a xcode update came along. I had to delete the file and create a new one, then all of the choices were there. Give that a shot. Always backup first.

Splash screen not visible for iPad, only a black screen gets shown

I have an universal app. The splash screen loads fine for iPhone but the same is not visible on the iPad. Instead a black screen appears in its place. I have gone through the questions posted in this regard and have followed the steps but to no avail. I am using asset catalog in my project. Storyboards have not been used. The names and dimensions of the images used are as follows:
1. Default-Landscape.png (1024x768)
2. Default-Landscape#2x.png (2048x1536)
3. Default-Portrait.png (768x1024)
4. Default-Portrait#2x.png (1536x2048)
5. Default-568h.png (640x1136)
6. Default.png (320x480)
7. Default#2x.png (640x960)
Please let me know if there is anything wrong with the dimensions I am using. The options I have selected for the Attributes Inspector for the Launch image are given in the image below:
Following is the setting for Launch image:
I added the same launch images to a sample app and the launch screen showed up perfectly on iPad.
EDIT:
As per the suggestion of #iphonemaclover, the problem was solved using "You should also remove any other key suffixed with (iPad) or ~ipad." There was a key UILaunchImages~ipad in the plist which I removed. Now the launch screen is properly visible.
Please delete your derived data and clean the your project.
Also reset your simmulater if you running over it.
Hope it will help.
Also check you have selected Universal App in your target setting.
EDIT
You should probably be using an Asset Catalogue for your launch images, which might be what Xcode is expecting. You can see what Xcode is expecting in the General tab for your target:
MORE Suggestion
Q: Why does my app launch to a black screen on iPad?
A: Apps that have been designed only for iPhone may launch to a blank screen when run on an iPad. This is caused by the presence of an empty iPad specific storyboard in the app bundle as well as an iPad specific UIMainStoryboardFile key in the app's Information Property List (Info.plist) file. Both are automatically created by the various Xcode template projects if the Universal option is selected.
...
In Xcode
Look for a file named MainStoryboard_iPad.storyboard in the file navigator. If this file is present, remove it from your project.
In In your app's Information Property List
Look for a key named Main storyboard file base name (iPad) or UIMainStoryboardFile~ipad. If this key is present, remove it. You should also remove any other key suffixed with (iPad) or ~ipad.
Finally, test your app on an iPad or in the iPad simulator and verify that it behaves as expected.
You should add your launch image to your asset catalogue, and make sure the setting shown is configured correctly.
If you don't have one already, you can add an asset catalogue by going to File > New > File, the look under the Resource tab.
Probably not related to most people's problems but I would like to add another possible issue. I had the same problem with my project. I could see my iPad images in X-Code but what I missed was that the title underneath was "unassigned" and not "iPad Portrait" (this was probably because it was a boilerplate React Native project that was initially configured only for iPhone).
After making my app universal, I needed to recreate my LaunchImage set which then had designated placeholders for iPad. I re-added all my images, assigned the new Launch Image set, clean, build and it was fixed. Hopefully it saves someone else some time.
If you're not loading an image in your slash screen do you get the white view? If you're not getting, then your view is not loaded. That is why you're getting a black screen.

iPhone 6 - app does not fill screen

Most of my apps scale up when run on an iPhone 6, but for some reason one of my apps looks like this:
What would cause it to not just scale up and fill the screen?
EDIT: Here are some repro steps:
Create a new project (Single View). Turn off size classes and just use iPhone.
Make the background orange.
Add a yellow UIView subview at (20,20,280,200).
In Xcode you get this:
Now simulate on iPhone 6. You get this:
Why doesn't it just scale up and look normal?
Not sure why this is getting downvoted. It's a legitimate question. And here's the legitimate answer:
Remove the "Launch Screen File" in Projects > General. Xcode 5 did not have this so older apps scale up automatically. Apps created with Xcode 6 get a default Launch Screen file created.
Removing it will make your app scale up on iPhone 6.
I have got the same problem and I managed to solve it by adding constraints to my ViewController in the storyboard.
Make sure that you clicked the ViewController of your scene. They yellow button in the this screenshot.
Click Editor-> Resolve Auto Layout issues -> Add Missing Constraints
Now you will find that the background image is scaled up to fill iPhone 6 or iPhone 6 plus.
Note that this solution works for me even if I did not provide any launch screen file.
I had the same issue. Searching for an answer, most of them mention the launch image. To me, what did the trick, was that I first enabled launch image for iOS8.0 and later in Xcode, which requires the native resolution sizes for 4.7" and 5.5". Adding these sizes didn't help, but when I re-disabled them, it started working!
If you do have any launch image, you will need launch images for all appropriate sizes. I was doing a minor update to an app, and it was not showing correctly on the iPhone 6 simulator. I created four launch images (.png files). Since the app should still run on iOS 7, I apparently could not use an asset catalog. I gave the images the correct names, and all is good.
Image sizes and names may be found here:
Sizes and Naming of Launch Image for iPhone app in iOS8

Xcode 6 Migrating to Images assets issues -- Black launch screen

I updated my application to use Image Asset for App Icon and Launch Images i set both with
appropriate image size according to Apple Doc. The issue that I have that for Iphone
and the simulator for (4S/5/5S) the launch image/screen is always black except for
Iphone 6+ but it works fine on iPad. I looked at couple of post here and nothing have
worked as follow
1) deleting the asset catalog and creating a new one
2) adding #2x and 3#x to each file before adding to the catalog
3) removing and redeploying the application
Anyone had that issue when porting image catalog ? Im using Xcode 6
Targeting ios 7 and 8
Thanks
Mike
Update 1
When disabling landscape launch screen appears normally
something i noticed before doing, so on either the device and the simulator
the application starts in landscape even if the device is held in portrait
and then it rotate to portrait. Still trying to solve that issue now
The following steps are worked for me:
Add the images to the project (root directory or Resources folder) with the following nomination (I will describe them into the Portrait launchimages): Degault.png (3.5 inch), Default-567h#2x (4 inch), Default-667h#2x (iPhone 6), Default-736#2x (iPhone 6plus).
Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to not use asset catalog ('Do not use asset catalogs').
Remove the LaunchImage asset from your main image asset
Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to use asset catalog
The XCode 6 is going to ask you about image asset migration from the existing images. Just click to 'Migrate'.
And it worked for me for each kind of devices on iOS7, iOS8.
Note:
If you check the new LaunchImage asset, than you can see it is really strange. It seems to contain only a few image without the images with iPhone6 or iPhone 6plus resolution.
I found that if I go to the app target general tab and remove all device orientations, the launch image will show again (i.e. the black screen goes away). After running the app, I then went back to the app target general tab and restored the desired device orientation and the launch images continue to work as desired.
(My answer should be in the comment section but I can't post it there due to my reputation)
May be these are very basic steps but:
Have you tried doing a full clean and deleting the derived data?
Have you checked the General tab of your target, under App Icons and Launch Images?

Launch images for universal application

I am trying to set default launch images from general setting section for my project using xcode 5.
Issue is when I am trying to set launch images for ios 6.1 and prior retina of iPhone and iPad, xcode is forcing me to rename the file name from Default~ipad#2x.png to Default.png and Default~iphone#2x.png to Default.png for iphone. But if both the files having same name get loaded then it is not showing proper launch images as per device type.
Can anyone guide me for the same? I have attached screenshot of error for more information.
Try this. Set the names to Default#2x~ipad.png and Default#2x~iphone.png

Resources