force_stop_app
Force stop Android apps to resolve unresponsiveness, crashes, or testing scenarios by terminating their processes immediately.
Instructions
Force stop an app
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>"
},
"name": "force_stop_app"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package_name | Yes | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:607-610 (handler)Handler function for the 'force_stop_app' tool. Uses the @mcp.tool() decorator which also handles registration in FastMCP. Executes ADB shell command to force-stop the specified app package.
@mcp.tool() def force_stop_app(package_name: str, device_serial: str | None = None) -> str: """Force stop an app""" return run_adb(["shell", "am", "force-stop", package_name], device_serial)