How to set Xcode simulator to programmatically rotate to landscape for iPhone/iPad through Selenium How to set Xcode simulator to programmatically rotate to landscape for iPhone/iPad through Selenium xcode xcode

How to set Xcode simulator to programmatically rotate to landscape for iPhone/iPad through Selenium


To display the device in landscape mode you can use the following line of code:

descap.setCapability("--main-frame-resizes-are-orientation-changes", "landscape");

Note: Ensure that descap is an instance of ChromeOptions() class.


According to Screen Orientation in Appium the following line should be all you need:

driver.rotate(org.openqa.selenium.ScreenOrientation.LANDSCAPE);


[[UIDevice currentDevice] setValue:    [NSNumber numberWithInteger: UIInterfaceOrientationPortrait]        forKey:@"orientation"];