---
title: Change screen orientation with Appium | TestingBot
description: Appium allows you to automatically change your screen orientation on
  Android and iOS
source_url:
  html: https://testingbot.com/support/app-automate/appium/screen-orientation
  md: https://testingbot.com/support/app-automate/appium/screen-orientation.md
---

# Change screen orientation

Appium allows you to change the screen orientation of your iOS and Android devices.   
 You can choose to either change the orientation [at the start of the test](https://testingbot.com#caps) or [during a test](https://testingbot.com#during).

## Set screen orientation at the start of your test
[Ruby](https://testingbot.com#) [Python](https://testingbot.com#) [PHP](https://testingbot.com#) [Java](https://testingbot.com#) [Node](https://testingbot.com#) [C#](https://testingbot.com#)

```ruby
capabilities = {
  "appium:orientation" => "LANDSCAPE"
}
```

```java
options.setCapability("appium:orientation", "LANDSCAPE");
```

```php
$capabilities = [
  "appium:orientation" => "LANDSCAPE"
];
```

```python
capabilities = {
  "appium:orientation": "LANDSCAPE"
}
```

```javascript
const capabilities = {
  "appium:orientation": "LANDSCAPE"
};
```

```csharp
options.AddAdditionalAppiumOption("appium:orientation", "LANDSCAPE");
```

## Set screen orientation during a test
[Ruby](https://testingbot.com#) [Python](https://testingbot.com#) [PHP](https://testingbot.com#) [Java](https://testingbot.com#) [Node](https://testingbot.com#) [C#](https://testingbot.com#)

```ruby
@driver.rotation = :landscape
```

```java
((AppiumDriver) driver).rotate(ScreenOrientation.LANDSCAPE);
```

```php
// php-webdriver has no rotate() helper; use the Appium W3C "mobile:" command
$driver->executeScript('mobile: setOrientation', ['orientation' => 'LANDSCAPE']);
```

```python
driver.orientation = "LANDSCAPE"
```

```javascript
await driver.setOrientation('landscape');
```

```csharp
driver.Orientation = ScreenOrientation.Landscape;
```

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

[Email us](https://testingbot.com/contact/new) [Join our Slack](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
