Skip to main content

Orientation · OrientationLocked

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Read which way the screen is turned, or turn it. These call app_orientation.

Orientation​

public string Orientation()
public string Orientation(string mode)

Which way the screen is turned. A screen that merely happens to be portrait can rotate under you, so OrientationLocked is a separate question.

Turns the screen and pins it there; "auto" hands it back to the sensor. "portrait", "landscape", "portrait-reverse" or "landscape-reverse" — not left/right, which the two platforms name differently. Discards the refs from the last map, since bounds do not survive a rotation.

OrientationLocked​

public bool OrientationLocked()

Whether the orientation is pinned rather than following the sensor.

Examples​

Turn the screen to landscape​

device.Orientation("landscape");

The same call from the command line, mobium orientation landscape, printed on an Android 15 emulator:

landscape (locked) (was portrait)

mobium orientation landscape on an Android 15 emulator

mobium orientation landscape on an Android 15 emulator