mobile_set_orientation
Adjust device screen orientation to portrait or landscape using the Mobile Next MCP server for automated mobile testing and interaction.
Instructions
Change the screen orientation of the device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orientation | Yes | The desired orientation |
Implementation Reference
- src/server.ts:451-462 (handler)MCP tool registration including schema, description, and handler logic for 'mobile_set_orientation'. The handler requires a selected robot (device) and delegates to its setOrientation method.tool( "mobile_set_orientation", "Change the screen orientation of the device", { orientation: z.enum(["portrait", "landscape"]).describe("The desired orientation"), }, async ({ orientation }) => { requireRobot(); await robot!.setOrientation(orientation); return `Changed device orientation to ${orientation}`; } );
- src/server.ts:455-455 (schema)Zod schema for the tool input parameter 'orientation'.orientation: z.enum(["portrait", "landscape"]).describe("The desired orientation"),
- src/robot.ts:114-123 (helper)Robot interface defining the setOrientation method called by the tool handler.* Change the screen orientation of the device. * @param orientation The desired orientation ("portrait" or "landscape") */ setOrientation(orientation: Orientation): Promise<void>; /** * Get the current screen orientation. */ getOrientation(): Promise<Orientation>; }
- src/android.ts:308-308 (helper)AndroidRobot implementation of setOrientation using adb to set user_rotation.public async setOrientation(orientation: Orientation): Promise<void> {
- src/ios.ts:189-189 (helper)IosRobot implementation delegating to WebDriverAgent.public async setOrientation(orientation: Orientation): Promise<void> {