adb_shell
Run a single shell command on a connected Android device to inspect or modify device state as its shell user; not for interactive input or APK installs.
Instructions
Run one shell command on a connected Android device via adb shell. As powerful as adb shell itself and can change or delete anything the device's shell user can - only use against a device you control. Not interactive (a command that waits for input will hang). Returns { command, stdout, stderr? } with stdout cut to its last 4000 characters and stderr to its last 2000. For installing an APK use adb_install; for reading logs use adb_logcat. Requires adb on PATH and an authorized device.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The command line to run on the device, as one string, e.g. "pm list packages -3" or "getprop ro.build.version.release". | |
| workspace | No | Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default". | |
| deviceSerial | No | Device serial from adb_devices, e.g. "emulator-5554" or "R58M123ABC". Only needed when more than one device is connected; omit otherwise. |