Skip to content

cagataycali/strands-adb

Repository files navigation

Strands ADB

strands-adb 🤖

Give your agent a phone.

PyPI Docs License

@tool decorated Android control for Strands Agents & DevDuck.

Drive any adb-connected Android device (phone / tablet / emulator) from an LLM — let your agent text people, read notifications, launch apps, take screenshots, drive the UI, take physical photos, stream logcat events, mutate settings.

📘 Full docs: cagataycali.github.io/strands-adb


Install

pip install strands-adb
brew install android-platform-tools    # or apt / pacman / winget

Enable USB debugging on your phone, plug it in, accept the trust dialog.

adb devices
# 59230DLCH0012Z  device

Quickstart

from strands import Agent
from strands_adb import adb

agent = Agent(tools=[adb])
agent("take a screenshot of my phone and describe what's on screen")

DevDuck (1 line)

export DEVDUCK_TOOLS="strands_adb:adb;strands_tools:shell"
devduck "open whatsapp and read the last message from mom"

👁️ Agent can SEE the screen

screenshot returns a proper Converse API image block — the same format as strands_tools.image_reader. The agent doesn't just get a file path, it actually receives the pixels and reasons over them:

agent("take a screenshot and tell me what app is open")
# → adb(action="screenshot") returns PNG bytes in Converse image block
# → vision model reads it → "You're on the WhatsApp chat with Mom..."

Disable with include_image=False if you just want the file path.

🎬 Record What The Agent Does

Non-blocking screen recording — start before the agent acts, stop after. Review the video to see what actually happened.

adb(action="screen_record_start", output_path="/tmp/run.mp4")

agent("open whatsapp and reply to mom")   # agent works while recording

result = adb(action="screen_record_stop")
print(result["merged_path"])   # single mp4, auto-stitched past 180s

Screen Recording guide

90+ Actions, One Tool

Domain Actions
Device list, select, info, battery, wake, unlock
UI tap, swipe, type, key, gestures, smart_tap
Screen screenshot (image block), screen_record, screen_record_start/stop (bg), frames, ui_dump, ui_find
Apps list, launch, kill, install, uninstall, clear_data
Files push, pull, ls
Intents open_url, share_text, start_activity
Camera camera_photo (image block), camera_video
Sensors accelerometer, gyro, light, pressure, step counter
Thermals CPU / skin / battery / GPU / modem temps
Settings brightness, ringer, airplane, bluetooth, any setting_put
Logs logcat one-shot, log_stream → event_bus, notifications_parsed
A11y enable services, captions, magnification, font scale
Comms dial, sms_compose, media_control, volume

Full actions guide

Docs

Safety

  • Dry-run mode for destructive ops
  • Allowlist/denylist for package operations
  • No plaintext PIN/password storage
  • Full audit logging of every adb invocation

Safety guide

License

MIT