skip to Main Content

Similar question here and not a single working answer:

Xcode not obeying device orientation

it doesn’t matter how I change the settings in Xcode 13 but when I run my app, it completely ignores the device orientation settings.

I just want my app to be in portrait but it looks like I can go landscape (left/right) and any other orientations!

This is my settings:

info.plist file:

enter image description here

Manual settings under the deployment:

enter image description here

anyones got a solution for this as this is a very annoying bug in Xcode!

3

Answers


  1. The ‘Device Orientation’ checkboxes seem to be broken in Xcode 13. They don’t modify the info.plist entries at all. Maybe this has to do with the new info.plist slim template that Apple introduced at WWDC 2021.

    Manually adding Supported device orientation (iPhone) seems to do the trick. However, it will not be reflected in Xcode Deployment Info’s checkboxes.

    info.plist

    Login or Signup to reply.
  2. I’m not sure if this is correct, but it solves the problem and the Device orientation checkboxes work again. It looks like an Xcode bug. What you need to do – just delete Supported interface orientations (iPhone) in Info.plist and select the necessary checkboxes in General

    XCode screenshot:

    XCode screenshot

    Login or Signup to reply.
  3. Check

    Targets > Build Settings > Info.Plist Values
    

    Only these values have real effect, and they may be different from all other Xcode project settings.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search