Device orientation - safari browser - iOS simulator/native browser on Android emulator

I am setting desired capability “device-orientation” to “landscape" on iOS simulator - but tests run on portrait mode. I see the following in the Appium log:
info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“8.1”,“platformName”:“iOS”,“deviceName”:“iPhone Simulator”,“browserName”:“Safari”,“device-orientation”:“landscape”}}
info: Client User-Agent string: Apache-HttpClient/4.3.5 (java 1.5)

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : device-orientation

iOS Simulator on local machine - here are the desired capabilities
deviceName: iPhone Simulator

deviceVersion: 8.1

platform: iOS

browserName: Safari

device-orientation: landscape

Appium verison is 1.3.4

#########

On Android also i observe same behavior.

info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“4.4”,“platformName”:“Android”,“deviceName”:“Android Emulator”,“browserName”:“Browser”,“device-orientation”:“landscape”}}

info: Client User-Agent string: Apache-HttpClient/4.3.5 (java 1.5)

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : device-orientation
info: Set mode: Proxying straight through to Chromedriver

how can get device orientation to work on “browsers” Android emulator/iOS simulator , any help here would be great.
Thanks
Silpa

There is no such capability as device-orientation. Try just orientation instead.

It seems like there is a bug in “bootstrap”. I am trying this in Android Emulator with “orientation” capacility but the application is opened in PORTRAIT only.

    File objFile=new File(appAPKFilePath);
    DesiredCapabilities capabilities=new DesiredCapabilities();
    capabilities.setCapability("deviceName", "Testing");
    capabilities.setCapability("app", objFile.getAbsolutePath());
    capabilities.setCapability("orientation", ScreenOrientation.LANDSCAPE);

capabilities.setCapability(“orientation”, “LANDSCAPE”);

Here in some portion of the Appium logs related orientation:

> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"D:\\UD\\jars\\Axis360.apk",**"orientation":"LANDSCAPE"**,"platformName":"Android","deviceName":"Testing"}}


> info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"D:\\UD\\jars\\Axis360.apk","orientation":"LANDSCAPE","platformName":"Android","deviceName":"Testing"},"app":"D:\\UD\\jars\\Axis360.apk","orientation":"LANDSCAPE","platformName":"Android","deviceName":"Testing"},"sessionId":"f5d35c4c-d9f0-4c08-a0b3-47415490c549"}
> info: <-- GET /wd/hub/session/f5d35c4c-d9f0-4c08-a0b3-47415490c549 200 3.479 ms - 543 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"D:\\UD\\jars\\Axis360.apk",**"orientation":"LANDSCAPE"**,"platformName":"Android","deviceName":"Testing"},"app":"D:\\UD\\jars\\Axis360.apk",**"orientation":"LANDSCAPE"**,"platformName":"Android","deviceName":"Testing"},"sessionId":"f5d35c4c-d9f0-4c08-a0b3-47415490c549"}
> info: --> POST /wd/hub/session/f5d35c4c-d9f0-4c08-a0b3-47415490c549/timeouts/implicit_wait {"ms":20000}

**> info: [debug] Pushing command to appium work queue: ["orientation",{}]**
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"orientation","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: orientation
**> info: [debug] Responding to client with success: {"status":0,"value":"PORTRAIT","sessionId":"f5d35c4c-d9f0-4c08-a0b3-47415490c549"}**
> info: <-- GET /wd/hub/session/f5d35c4c-d9f0-4c08-a0b3-47415490c549/orientation 200 31.184 ms - 82 {"status":0,"value":"PORTRAIT","sessionId":"f5d35c4c-d9f0-4c08-a0b3-47415490c549"}
**> info: [debug] [BOOTSTRAP] [debug] Current rotation: ROTATION_0**
**> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"PORTRAIT"}**

Here why it automatically switches to PORTRAIT orientation?

WebDriver augmentedDriver = new Augmenter().augment(((WrapsDriver)driver).getWrappedDriver());
((Rotatable)augmentedDriver).rotate(ScreenOrientation.LANDSCAPE);

this seems to work for iOS safari browser.

But for android native stock browser — it is not working.