why Xcode 13 ignores devices orientation settings at all costs?

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!


Solution 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

Solution 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