Skip to main content

@tool decorated Android control for Strands Agents

Project description

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

[![Awesome Strands Agents](https://img.shields.io/badge/Awesome-Strands%20Agents-00FF77?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjkwIiBoZWlnaHQ9IjQ2MyIgdmlld0JveD0iMCAwIDI5MCA0NjMiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik05Ny4yOTAyIDUyLjc4ODRDODUuMDY3NCA0OS4xNjY3IDcyLjIyMzQgNTYuMTM4OSA2OC42MDE3IDY4LjM2MTZDNjQuOTgwMSA4MC41ODQzIDcxLjk1MjQgOTMuNDI4MyA4NC4xNzQ5IDk3LjA1MDFMMjM1LjExNyAxMzkuNzc1QzI0NS4yMjMgMTQyLjc2OSAyNDYuMzU3IDE1Ni42MjggMjM2Ljg3NCAxNjEuMjI2TDMyLjU0NiAyNjAuMjkxQy0xNC45NDM5IDI4My4zMTYgLTkuMTYxMDcgMzUyLjc0IDQxLjQ4MzUgMzY3LjU5MUwxODkuNTUxIDQxMS4wMDlMMTkwLjEyNSA0MTEuMTY5QzIwMi4xODMgNDE0LjM3NiAyMTQuNjY1IDQwNy4zOTYgMjE4LjE5NiAzOTUuMzU1QzIyMS43ODQgMzgzLjEyMiAyMTQuNzc0IDM3MC4yOTYgMjAyLjU0MSAzNjYuNzA5TDU0LjQ3MzggMzIzLjI5MUM0NC4zNDQ3IDMyMC4zMjEgNDMuMTg3OSAzMDYuNDM2IDUyLjY4NTcgMzAxLjgzMUwyNTcuMDE0IDIwMi43NjZDMzA0LjQzMiAxNzkuNzc2IDI5OC43NTggMTEwLjQ4MyAyNDguMjMzIDk1LjUxMkw5Ny4yOTAyIDUyLjc4ODRaIiBmaWxsPSIjRkZGRkZGIi8+CjxwYXRoIGQ9Ik0yNTkuMTQ3IDAuOTgxODEyQzI3MS4zODkgLTIuNTc0OTggMjg0LjE5NyA0LjQ2NTcxIDI4Ny43NTQgMTYuNzA3NEMyOTEuMzExIDI4Ljk0OTIgMjg0LjI3IDQxLjc1NyAyNzIuMDI4IDQ1LjMxMzhMNzEuMTcyNyAxMDMuNjcxQzQwLjcxNDIgMTEyLjUyMSAzNy4xOTc2IDE1NC4yNjIgNjUuNzQ1OSAxNjguMDgzTDI0MS4zNDMgMjUzLjA5M0MzMDcuODcyIDI4NS4zMDIgMjk5Ljc5NCAzODIuNTQ2IDIyOC44NjIgNDAzLjMzNkwzMC40MDQxIDQ2MS41MDJDMTguMTcwNyA0NjUuMDg4IDUuMzQ3MDggNDU4LjA3OCAxLjc2MTUzIDQ0NS44NDRDLTEuODIzOSA0MzMuNjExIDUuMTg2MzcgNDIwLjc4NyAxNy40MTk3IDQxNy4yMDJMMjE1Ljg3OCAzNTkuMDM1QzI0Ni4yNzcgMzUwLjEyNSAyNDkuNzM5IDMwOC40NDkgMjIxLjIyNiAyOTQuNjQ1TDQ1LjYyOTcgMjA5LjYzNUMtMjAuOTgzNCAxNzcuMzg2IC0xMi43NzcyIDc5Ljk4OTMgNTguMjkyOCA1OS4zNDAyTDI1OS4xNDcgMC45ODE4MTJaIiBmaWxsPSIjRkZGRkZGIi8+Cjwvc3ZnPgo=&logoColor=white)](https://github.com/cagataycali/awesome-strands-agents)

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"

MCP Server (Claude Code / Claude Desktop / Cursor / any MCP client)

Expose adb + recorder over the Model Context Protocol:

pip install "strands-adb[mcp]"

# stdio mode (default) — for Claude Code / Claude Desktop
strands-adb-mcp

# HTTP mode — multi-client, background-capable
strands-adb-mcp --http --port 8000

Claude Code:

claude mcp add strands-adb -- strands-adb-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "strands-adb": {
      "command": "strands-adb-mcp"
    }
  }
}

Now any MCP client can control your Android device — screenshots, UI automation, app control, sensors, everything.


👁️ 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strands_adb-0.19.3.tar.gz (116.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strands_adb-0.19.3-py3-none-any.whl (84.1 kB view details)

Uploaded Python 3

File details

Details for the file strands_adb-0.19.3.tar.gz.

File metadata

  • Download URL: strands_adb-0.19.3.tar.gz
  • Upload date:
  • Size: 116.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for strands_adb-0.19.3.tar.gz
Algorithm Hash digest
SHA256 446fea57b600f2607e8322d11e9680d92d708ead595f88136de356158a8687e3
MD5 2626910eae35273734076ecabe981e34
BLAKE2b-256 c96a0896bbbb38217e707f8bcd7cf0a341f4b86d9fc4f65be3ca314dcc420ead

See more details on using hashes here.

File details

Details for the file strands_adb-0.19.3-py3-none-any.whl.

File metadata

File hashes

Hashes for strands_adb-0.19.3-py3-none-any.whl
Algorithm Hash digest
SHA256 67e1efffdb14f18472b82bbc34bfb568a9d814b49efb86b68ff1baf6a735ffe4
MD5 aa707b55e86264ee032d650a496dd89e
BLAKE2b-256 434afe3e9057ca96abc83c4ac14ce00c3e0826bea7f2e0b88f4642b5c32d7207

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page