mobile_type
Input text into Android text fields and optionally submit using Enter key. Enables automated text entry for mobile device interaction and testing.
Instructions
Input text into the currently focused text field on Android.
Args: text: The text to input submit: Whether to submit text (press Enter key) after typing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| submit | No | ||
| text | Yes |
Implementation Reference
- main.py:145-162 (handler)The complete implementation of the 'mobile_type' tool, including its @mcp.tool() decorator for registration and the full handler function logic using uiautomator2's device.send_keys() to input text into the focused field, with optional submit via Enter key.@mcp.tool() def mobile_type(text: str, submit: bool = False) -> str: """Input text into the currently focused text field on Android. Args: text: The text to input submit: Whether to submit text (press Enter key) after typing """ if device is None: return "Error: Device not initialized. Please call mobile_init() first to establish connection with Android device." try: device.send_keys(text) if submit: device.press("enter") return f"Successfully input text: {text} and pressed Enter" return f"Successfully input text: {text}" except Exception as e: return f"Error inputting text: {str(e)}"