launch_activity
Start a specific Android activity by providing package and activity names to launch app components for testing or development workflows.
Instructions
Launch a specific activity
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"package_name": "<package_name>",
"activity_name": "<activity_name>"
},
"name": "launch_activity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package_name | Yes | ||
| activity_name | Yes | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:596-604 (handler)The handler function decorated with @mcp.tool(), which registers it as an MCP tool. Launches a specific Android activity using ADB by constructing the component name and executing the 'am start' command.
@mcp.tool() def launch_activity( package_name: str, activity_name: str, device_serial: str | None = None ) -> str: """Launch a specific activity""" component = f"{package_name}/{activity_name}" return run_adb(["shell", "am", "start", "-n", component], device_serial)