shell_exec
Execute shell commands on an Android device through ADB to inspect or control it, returning exit code, stdout, and stderr.
Instructions
Run an arbitrary shell command on the device (run-as-shell of the adb user). Returns exit code, stdout, stderr. Destructive by definition.
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": {
"command": "<command>"
},
"name": "shell_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory to cd into first (optional) | |
| command | Yes | Shell command, e.g. 'pm list packages | head' | |
| timeout | No | Seconds before giving up (default 60) |