Rotate iOS Simulator via XCUITest

38 Views Asked by At

I am trying to rotate the iOS device for my XCUITest for a SwiftUI application on simulator version iOS 17.x. I am able to get the app to rotate but the simulator is not rotating. Does anyone have advice?

I am using the following:

if ProcessInfo.processInfo.environment["ORIENTATION"] == "landscape" {
        XCUIDevice.shared.orientation = .landscapeLeft
 }

The Deployment section has the rotation supported: enter image description here

When I run the test, it rotates the application but NOT the iOS simulator window. It is still in Portrait mode.
enter image description here

The Device setting is set to auto rotate: enter image description here

0

There are 0 best solutions below