mobile_init
Establish connection to Android devices for UI automation, enabling screen interaction, app control, and testing capabilities through ADB.
Instructions
Initialize the Android device connection.
Must be called before using any other mobile tools.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:85-97 (handler)The handler function for the 'mobile_init' tool, decorated with @mcp.tool() which also serves as its registration in the FastMCP server. It initializes the connection to the Android device using uiautomator2.@mcp.tool() def mobile_init() -> str: """Initialize the Android device connection. Must be called before using any other mobile tools. """ global device try: device = u2.connect() return "Device initialized successfully" except Exception as e: device = None return f"Error initializing device: {str(e)}"
- main.py:85-85 (registration)The @mcp.tool() decorator registers the mobile_init function as an MCP tool.@mcp.tool()