I need to tweak some UI elements for that lovely iPhone X notch . When running in the Xcode simulator, the value for UnityEngine.iOS.Device.generation is always “Unknown”. I’ve tried multiple devices and iOS versions to confirm.
When running a test build on an actual device, the value is correct.
Is this a bug with Unity or a limitation of the iOS simulator?
Might try the iOS subforum on here Unity Engine - Unity Discussions as you may have better luck. (I don’t do iOS builds, so I have no advice on the simulator)
But it’s very possible it’s just how the simulator is. I know that many times things don’t always behave the way we expect unless it’s built to a real device.
My workaround for this is to test UnityEngine.iOS.Device.generation - if it’s Unknown, then fallback to testing the screen aspect ratio. If it’s < 0.5, I assume iPhone X (Simulator). Hacky, I’ll admit, but works.