I am developing my first SwiftUI app and get a weird issue.
My configuration is : MacBook Pro with Catalina 10.15.4 ; Xcode 11.4.
I build and run my app with Simulator for iPhone 8 - iOS 13.4. The app works well.
Then I build and run my app with Simulator for iPhone 8Plus - iOS 13.4. The app works well.
Then I build and run my app on my personal iPhone 8Plus - iOS 13.4. The app looks different. Some Text views are truncated on the Home screen and on the List screen.
Why does it work on the Simulator (for same size or smaller size) and not on the real device ?
To investigate the problem, with the Simulator, I made some screenshots. With the File Inspector, I checked the Image sizes.
For the iPhone 8, the Image size says 750x1334 pixels. No surprise as it is the expected rendered resolution.
For the iPhone 8 Plus, the Image size says 1242x2208 pixels. Surprise ! Never seen this size before. Any clue ?
Taking now the Simulator for iPhone 11, Image size says 828x1792 pixels. No surprise neither.
So why the image size is not the expected rendered size for the iPhone 8 Plus (eg. 1080x1920) ?
Does it mean I run in fact a larger (than iPhone 8 Plus) simulator ?
I would appreciate any assistance.
on my iPhone 8 Plus
Issue is icons displaying properly in iPhone 5 but when comes to iPhone 6 all icons moved little left side.This image is taken from iPhone 6
My app is built for iOS 8.3 and runs on different screen sizes. I laid everything out to fit iPhone 6 correctly.
When running my app on iPad device the app is in letterbox iPhone 4 size screen, How can I get it to be iPhone 6 size inside the iPad ?
How to change Display Zoom feature in iPhone 6 and 6 Plus simulators?
Original iPhone 6 and 6 Plus have this feature in Settings -> Display & Brightness -> Display Zoom (View) with values Standard and Zoomed.
As of Xcode 12 (and perhaps earlier) Settings -> Developer -> View -> Zoomed (tap Set) will adjust the simulator to show with Display Zoom. This is helpful as the iPhone 11 Pro, iPhone 12 mini, iPhone 12, and iPhone 12 Pro all run at a previously unused resolution of 320 x 693. For more information check out this excellent article by Geoff Hackworth.
Display Zoom is not available in the simulator (as of Xcode 6.0).
The answer is correct, Display Zoom is not available as an option in the current Xcode 7 iOS simulator settings. However, it is actually possible to 'simulate' Display Zoom when running your app in the simulator.
Background
When building a typical project for iPhone, you generally specify a LaunchScreen.storyboard file and/or launch images in Images.xcassets for the iPhone 4/4s (2x), iPhone 5/5s (Retina 4), iPhone 6/6s (Retina HD 4.7) and iPhone 6+/6s+ (Retina HD 5.5) and set those details in the project's settings. (See image below.)
When Display Zoom is turned ‘on’ for a iPhone 6/6s device, the device runs the app as if it was running on an iPhone 5/5s sized screen, upscaling the app x1.172 to fit the iPhone 6/6s display. (Similarly, when Display Zoom is turned ‘on’ for a iPhone 6+/6+s device, the device runs the app as if it was running on an iPhone 6/6s sized screen, upscaling the app to fit the iPhone 6+/6+s display.)
Note - The following instructions require the removal of some launch screen image files. You might wish to attempt these changes on a duplicate of your Xcode project.
Simulating Display Zoom on the iOS Simulator
To simulate Display Zoom for example using the iPhone 6 simulator in Xcode:
1 - Remove the LaunchScreen.storyboard file.
2 - Remove both the Retina HD 4.7 and Retina HD 5.5 launch images in Images.xcassets. (Make sure to keep the Retina 4 launch image.)
3 - Remove the reference to the ‘Launch Screen File’ in your Xcode project’s settings, under ‘General’, under ‘App Icons and Launch Images’.
4 - Select the iPhone 6/6s simulator, and then 'Run' your app.
Running your app
When the simulator runs your app, it will detect that no launch images are present for iPhone 6/6s, so it will presume it must be an iPhone 5/5s app and launch it into the simulator upsampling a iPhone 5/5s sized screen to fit the iPhone 6/6s screen, just as the Display Zoom setting would display it!
My hard drive crashed, and I had to re-install all the development software.
It seems like when I create a new project, it is targeted for the iPhone 5 (The UI editor has a taller screen in the layout) but the simulator is an iPhone 4 (the screen is not as long) All so When I layout the UI in Xcode, the simulator sometimes draws things at different vertical positions.
Is there a way to get a simulator for iPhone 5?
Can you create a project that has it so the UI editor is targeted for the older iPhone, iPhone 4?
You can select either of the simulators you want for your project:
iPhone Retina (3.5-inch) is for iPhone 4 or iPhone 4S and iPhone Retina (4-inch) is for iPhone 5.