execute_adb_command
Execute Android Debug Bridge commands to control devices and emulators programmatically, with safe parsing to prevent shell injection.
Instructions
The output of an ADB command. Parsed safely via shlex and never passed to a system shell.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ADB command to execute. Parsed safely — no shell injection possible. | |
| use_shell | No | When True, runs as an Android shell command (adb shell ...). When False, runs as a top-level ADB command (adb devices, adb install, etc.). | |
| device_serial | No | Android device serial (e.g. 'emulator-5554' or '192.168.1.10:5555'). Omit only when a single device is connected. If the tool returns a multi-device error: STOP. Present the device list to the user verbatim and wait for their explicit choice. Do NOT retry with a guessed or inferred serial — this is a hard requirement. Once the user provides a serial, use it for every subsequent call in this session. To switch devices mid-session, ask the user first. |