Run shell command
adb_shellRun shell commands on an Android device over ADB and return stdout for settings, pm, am, dumpsys, getprop, wm, cmd, or svc. Requires allow_shell; use adb_app for dry-run package changes.
Instructions
Run a shell command on the device (settings, pm, am, dumpsys, getprop, wm, cmd, svc...) and return stdout. It bypasses every guard rail, so it works only while the server option allow_shell is on. For package changes use adb_app instead: dry runs, a protected set, a network guard and a rollback snapshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial | No | Device serial from adb_devices. Optional when exactly one device is connected. | |
| command | Yes | Command line for the device shell, e.g. "getprop ro.build.version.release". Logged verbatim with log_requests: type secrets with adb_text instead. | |
| timeout_sec | No | Time limit in seconds, default 30, at most 120. Past it the call fails with "timed out". |