1

I would like to make screenshots of my app in IOS-Simulator. This works fine with CMD-S, but I have always black parts in my screen, because the windows is not autosized to the simulated devices screensize.

Is there a way to autosize the window to fit with the screensize of the simulator ?

Screenshot: The white part is the content of the device. The black is obsolete and is a window from the MAC. When taking the screenshot from this, I still have to cut out the content to have a good screenshot.

enter image description here

mcfly soft
  • 11,289
  • 26
  • 98
  • 202
  • can you explain more what is this black areas? I didn't understand. – hasan Aug 02 '15 at 07:44
  • add a screen shot please. – hasan Aug 02 '15 at 07:46
  • Yes, you are right, this really needs a screen to explain it. My MAC-Window is oversized, so the screenshot will have the obsolete black part too. – mcfly soft Aug 02 '15 at 08:17
  • are you using launch screen images or launch screen file? check your target settings and scroll down in general section. – hasan Aug 02 '15 at 08:39
  • Have you tried your app on a real iPhone 6? Does it render correctly? I have never seen the simulator behave the way it is in your screen shot, which leads me to believe that your app isn't actually displaying correctly and that the black would be visible on a real device too – Paulw11 Aug 02 '15 at 08:41
  • No thats not possible, because I know the with in points in my code and this is correct. I didn't try on a real iphone, but I am pretty sure thats not the reason. – mcfly soft Aug 02 '15 at 08:43
  • Try it on a real device – Paulw11 Aug 02 '15 at 09:05

2 Answers2

1

This used to happen in earlier to iOS SDKS when you don't set a launch images for all devices.

In your case, I think you don't have the launch screen file set. this can be solved by setting that file at general section in the target's settings.

Alternatively, set launch screen images for all devices.

Check my answer here.

One more thing to try: At the top bar in simulator. choose the Window menu then Scale and play with those values.

Community
  • 1
  • 1
hasan
  • 23,815
  • 10
  • 63
  • 101
  • Thanks for helping. I changed the setting (General -> Target -> Launch Screen File from LaunchScreen.xib to Main.storyboard). The inital LaunchScreen is gone, but the window is still oversized. I replaced the screenshot to show this better. The IOS simulator starts already oversized before my app is started. Any other help ? – mcfly soft Aug 02 '15 at 11:39
  • do you have the LaunchScreen file in your project? don't use the main storyboard as launch screen get back to the LaunchScreen file. – hasan Aug 02 '15 at 11:46
  • Your case is strange. try to reset the simulator. simulator menu. Reset content and settings. – hasan Aug 02 '15 at 11:46
  • Also, clean and rebuild your project. – hasan Aug 02 '15 at 11:47
  • 1
    I guess it has nothing to do with my app. When I kill the IOS simulator and I start the simulator with "Xcode"->"Open Developer Tools"->"IOS Simulator" then the screen I atttached shows up. – mcfly soft Aug 02 '15 at 11:48
  • I think you are right. it not the app for sure. its a problem in the simulator. – hasan Aug 02 '15 at 11:49
  • So you have the same expirience ? – mcfly soft Aug 02 '15 at 11:52
  • no I don't. I added something to the answer. try it. – hasan Aug 02 '15 at 11:53
  • Thanks, but I already played with this. It just scales the MAC window and also the content, means the IPhone's content. So this doesn't help. – mcfly soft Aug 02 '15 at 12:49
  • 1
    NEWS: I restarted the MAC and just started the IOS-Simulator after starting the XCode. Then it is showing the windows as intended. I dont know what solved the problem, but I guess it has to do with the mentoined launchscreen probable, which was startet the first time. No that I removed the launchscreen and rebooted the MAC it works. Shall I accept the answer ? – mcfly soft Aug 02 '15 at 12:56
  • I don't think so. just an upvote :) would be appropriate – hasan Aug 02 '15 at 13:01
  • You can answer your own question you know and then accept it. I will upvote it. – hasan Aug 02 '15 at 13:02
0

I solved it the following way, but I don't know what was the reason.

  • I removed the launchscreen as hasan83 suggested. This did not the trick yet.
  • I restarted the MAC
  • I started XCode ("Xcode"->"Open Developer Tools"->"IOS Simulator")
  • I started the ios simulator without starting my app. -> MAC-Windows fit with the simulated device screen
  • I started my app and now it looks as intended.

Thanks for helping to all involved people !

mcfly soft
  • 11,289
  • 26
  • 98
  • 202