How to change the device orientation

Hi ,

I need to change the device orientation to landscape what could be the code for it…when i use screenorientation.landscape() the page alone is changed…

Deepika,Use this code to change the device Orientation


    if (rotateAction.equalsIgnoreCase("PORTRAIT")) {
    if (!orientation.value().equalsIgnoreCase(rotateAction)) {


 private void setDeviceRotation(String deviceName) {

    if (deviceName.contains(IPHONE)) {
        iosDriver.rotate(ScreenOrientation.PORTRAIT);"Set rotation portrait mode for " + deviceName);

    if (deviceName.contains(IPAD)) {
        iosDriver.rotate(ScreenOrientation.LANDSCAPE);"Set rotation landscape mode for " + deviceName);

Thank you but i have used the same but still getting the same error.
my screen is looking in this way

code snippet:

ScreenOrientation.LANDSCAPE - it will rotate the only screen.
Why do you need to rotate device?

But when i was using 1.6.3 version of appium the device was changing to landscape…

Something Wrong in appium