Skip to main content
Glama
mobile-next

Mobile Next MCP Server

Official
by mobile-next

mobile_set_orientation

Change the screen orientation of mobile devices to portrait or landscape for enhanced testing and automation workflows within the Mobile Next MCP Server environment.

Instructions

Change the screen orientation of the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orientationYesThe desired orientation

Implementation Reference

  • The primary handler for the 'mobile_set_orientation' tool. It resolves the device to a Robot instance and calls setOrientation(orientation) on it. Includes inline schema and registration via the 'tool' helper.
    tool( "mobile_set_orientation", "Change the screen orientation of the device", { device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), orientation: z.enum(["portrait", "landscape"]).describe("The desired orientation"), }, async ({ device, orientation }) => { const robot = getRobotFromDevice(device); await robot.setOrientation(orientation); return `Changed device orientation to ${orientation}`; } );
  • AndroidRobot.setOrientation implementation using ADB commands to disable auto-rotation and set user_rotation.
    public async setOrientation(orientation: Orientation): Promise<void> { const value = orientation === "portrait" ? 0 : 1; // disable auto-rotation prior to setting the orientation this.adb("shell", "settings", "put", "system", "accelerometer_rotation", "0"); this.adb("shell", "content", "insert", "--uri", "content://settings/system", "--bind", "name:s:user_rotation", "--bind", `value:i:${value}`); }
  • IosRobot.setOrientation delegates to WebDriverAgent (WDA).
    public async setOrientation(orientation: Orientation): Promise<void> { const wda = await this.wda(); await wda.setOrientation(orientation); }
  • Simctl.setOrientation (iOS Simulator) delegates to WebDriverAgent (WDA).
    public async setOrientation(orientation: Orientation): Promise<void> { const wda = await this.wda(); return wda.setOrientation(orientation); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mobile-next/mobile-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server