mobile_bash
Execute shell commands on connected Android or HarmonyOS devices via ADB/HDC, returning exit code, stdout, and stderr for remote diagnostics.
Instructions
Run a shell command on the device (adb/hdc platforms only).
A non-zero command exit is reported in data.exitCode, not as a tool error — the API call itself succeeded.
Args: serialno: The mobile device serialno, from list_devices. command: The shell command to run.
Returns: JSON envelope whose data carries exitCode, stdout and stderr.
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": {
"serialno": "<serialno>",
"command": "<command>"
},
"name": "mobile_bash"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| serialno | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |