Type Text
mobile_type_keysType text into mobile app elements and optionally submit it for automated testing and interaction on iOS and Android devices.
Instructions
Type text into the focused element
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | The device identifier to use. Use mobile_list_available_devices to find which devices are available to you. | |
| text | Yes | The text to type | |
| submit | Yes | Whether to submit the text. If true, the text will be submitted as if the user pressed the enter key. |
Implementation Reference
- src/server.ts:492-501 (handler)The handler function for the mobile_type_keys tool. It retrieves the appropriate Robot instance for the device, sends the text keys to the focused element, and optionally submits by pressing ENTER.
async ({ device, text, submit }) => { const robot = getRobotFromDevice(device); await robot.sendKeys(text); if (submit) { await robot.pressButton("ENTER"); } return `Typed text: ${text}`; } - src/server.ts:487-491 (schema)Zod input schema defining parameters: device (string), text (string), submit (boolean).
{ device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), text: z.string().describe("The text to type"), submit: z.boolean().describe("Whether to submit the text. If true, the text will be submitted as if the user pressed the enter key."), }, - src/server.ts:483-502 (registration)Registration of the 'mobile_type_keys' MCP tool using the internal 'tool()' helper, including title, description, schema, and handler callback.
tool( "mobile_type_keys", "Type Text", "Type text into the focused element", { device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), text: z.string().describe("The text to type"), submit: z.boolean().describe("Whether to submit the text. If true, the text will be submitted as if the user pressed the enter key."), }, async ({ device, text, submit }) => { const robot = getRobotFromDevice(device); await robot.sendKeys(text); if (submit) { await robot.pressButton("ENTER"); } return `Typed text: ${text}`; } );