How to rotate simulator using Swift code in xcode ui test
Swift 4:
XCUIDevice.shared.orientation = .landscapeLeft
XCUIDevice.shared.orientation = .portrait
Have you tried this?
Swift 2.x
XCUIDevice.sharedDevice().orientation = .LandscapeLeft
XCUIDevice.sharedDevice().orientation = .Portrait
Swift 3.0
XCUIDevice.shared().orientation = .landscapeLeft
XCUIDevice.shared().orientation = .portrait
Swift 5.x
XCUIDevice.shared.orientation = .landscapeLeft
XCUIDevice.shared.orientation = .portrait