API Reference¶
The full adb tool signature. One tool, 90+ actions, dispatched via action="...".
All actions return:
{
"status": "success" | "error",
"content": [{"text": "..."}, {"image": {...}}?],
# action-specific extras
}
Device¶
list_devices¶
adb(action="list_devices")
# Returns: {"devices": [{"serial": "...", "state": "device", "model": "..."}]}
select_device¶
Sets process-global default serial.
device_info¶
adb(action="device_info", serial=None)
# Returns model, manufacturer, Android version, SDK, serialno
battery¶
wake¶
unlock¶
PIN is used once, not stored.
Shell¶
shell¶
Run arbitrary adb shell <cmd>.
UI Input¶
tap¶
swipe¶
type_text¶
key¶
back / home / recent¶
gesture_long_press¶
gesture_path¶
gesture_pinch¶
gesture_stream¶
Screen¶
screenshot¶
adb(action="screenshot",
output_path=None, # default: /tmp/adb_screenshot_<ts>.png
serial=None,
include_image=True, # embed Converse image block
return_base64=False)
Returns {path, size_bytes, content: [text, image]}.
screen_record¶
Blocking fixed-duration recording (≤180s Android hard limit).
screen_record_start¶
Start a non-blocking background recording. Returns immediately so your agent can keep acting. Auto-chains segments past Android's 180s cap.
adb(
action="screen_record_start",
output_path="/tmp/run.mp4",
screenrec_bit_rate_mbps=4,
screenrec_size="720x1600", # None = native resolution
screenrec_segment_sec=180,
)
screen_record_stop¶
Stop background recording. Pulls any remaining segment, optionally merges
all segments via ffmpeg if present.
result = adb(action="screen_record_stop")
# {
# "segments": ["/tmp/run.mp4", "/tmp/run_seg002.mp4", ...],
# "merged_path": "/tmp/run_merged.mp4", # if ffmpeg available
# "duration_sec": 412.3,
# "total_bytes": 198_234_112,
# }
screen_record_status¶
adb(action="screen_record_status")
# {"running": True, "elapsed_sec": 47.3, "segments": [...], "output_path": "..."}
screen_frames¶
video_frames¶
ui_dump¶
Returns full UIAutomator XML.
ui_find¶
Returns list of matching nodes with bounds + attrs.
ui_tap_by¶
ui_wait_for¶
adb(action="ui_wait_for",
text=None, resource_id=None, content_desc=None,
timeout_sec=10, serial=None)
smart_tap¶
High-level semantic tap.
Camera¶
camera_photo¶
adb(action="camera_photo",
facing="back", # "back" | "front"
output_path=None,
auto_pull=True,
include_image=True,
return_base64=False,
timeout_sec=15,
serial=None)
Returns {path, device_path, size_bytes, content: [text, image]}.
camera_video¶
Apps¶
list_packages¶
launch¶
kill¶
install¶
uninstall¶
clear_data¶
current_app¶
Files¶
push¶
pull¶
ls¶
Intents¶
open_url¶
share_text¶
start_activity¶
adb(action="start_activity",
action_name="android.intent.action.VIEW",
data=None, package=None, component=None,
extras=None, serial=None)
Sensors¶
sensors¶
adb(action="sensors", serial=None)
# Returns structured accelerometer, gyro, light, proximity, pressure, ...
thermals¶
wifi_info¶
Settings¶
setting_get¶
adb(action="setting_get",
namespace="global", # "global" | "system" | "secure"
key="airplane_mode_on",
serial=None)
setting_put¶
adb(action="setting_put",
namespace="system", key="screen_brightness", value="128",
dry_run=False, serial=None)
setting_delete¶
setting_list¶
setting_dump¶
set_ringer¶
set_brightness¶
set_bluetooth¶
set_airplane_mode¶
Logs / Notifications¶
logcat¶
log_stream_start¶
adb(action="log_stream_start",
filter="NotificationManagerService",
topic="phone.notifications",
serial=None)
log_stream_stop¶
log_stream_status¶
notifications¶
Raw dumpsys output.
notifications_parsed¶
dismiss_notifications¶
Accessibility¶
accessibility_list¶
accessibility_toggle_service¶
adb(action="accessibility_toggle_service",
service="com.google.android.accessibility.talkback/.TalkBackService",
enabled=True, serial=None)
accessibility_system_action¶
adb(action="accessibility_system_action", id="home", serial=None)
# ids: home, back, notifications, quick_settings, ...
accessibility_captions¶
accessibility_magnification¶
accessibility_font_scale¶
accessibility_status¶
Comms¶
dial¶
adb(action="dial", phone="+1234567890", call=False, serial=None)
# call=True auto-places the call, call=False just opens dialer
sms_compose¶
media_control¶
adb(action="media_control", action="play", serial=None)
# actions: play | pause | next | previous | stop | play_pause
volume¶
Environment¶
| Var | Default | Purpose |
|---|---|---|
ADB_BIN |
adb (PATH) |
adb binary path |
ADB_SERIAL |
none | default device serial |
Response Shape¶
{
"status": "success" | "error",
"content": [ # Converse API content blocks
{"text": "human-readable summary"},
{"image": {"format": "png" | "jpeg",
"source": {"bytes": b"..."}}},
],
# action-specific fields (examples):
"path": "/tmp/shot.png",
"size_bytes": 284512,
"devices": [...],
"info": {...},
"settings": {...},
"events": [...],
}
See Also¶
- Actions Overview — grouped intro
- Architecture — how the dispatch works
- GitHub source