mobile_init
Initialize Android device connection to enable UI manipulation, screen capture, touch gestures, and app management. Required before using other mobile automation tools.
Instructions
Initialize the Android device connection.
Must be called before using any other mobile tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- main.py:85-98 (handler)The handler function for the 'mobile_init' tool. It uses the @mcp.tool() decorator for registration and implements the logic to connect to the Android device using uiautomator2.connect(), setting the global 'device' variable.@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)}"