Control Android devices in the user's home over ADB - a TV, a TV box, a phone or a tablet. Use when the user asks to turn something on or off, open an app (Netflix, YouTube, Spotify...), play, pause, change the volume, navigate a menu, type into a field, see what is on the screen, or take a screenshot of a device. Also use when a device's IP has changed and needs to be found again.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Adb Ai?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/cyberpunk2183-adb-ai)
---
name: adb-ai
description: Control Android devices in the user's home over ADB - a TV, a TV box, a phone or a tablet. Use when the user asks to turn something on or off, open an app (Netflix, YouTube, Spotify...), play, pause, change the volume, navigate a menu, type into a field, see what is on the screen, or take a screenshot of a device. Also use when a device's IP has changed and needs to be found again.
---
# Controlling devices over ADB
`adb-ai` wraps `adb` with device discovery, friendly key names, app aliases and
state checks. Run it through your shell tool.
## First: make sure a device is there
```bash
adb-ai devices # what is connected
adb-ai scan # find devices on the local network (DHCP moves them)
adb-ai connect 192.168.0.42 --alias tv # connect and remember it as "tv"
```
Home networks hand out addresses by DHCP, so **an address that worked yesterday
often fails today**. If a command reports *no route to host* or *no device
connected*, run `adb-ai scan`, then `connect` the address it finds. Do not keep
retrying the old address.
A phone or tablet on Android 11+ that has never been paired with this machine
will not connect at all until it is. `adb-ai pair` draws a QR code the user
scans from *Wireless debugging → Pair device with QR code* — show them the
command, tell them which screen to open, and let it run; it pairs and connects
by itself. It needs a screen the device's camera can see, so it is a desktop
move: it cannot pair the phone the terminal is running on.
Add `--mirror` when the user wants to watch the phone straight away: it opens
scrcpy as soon as the pairing connects, and `adb-ai scan --mirror` and
`adb-ai connect <ip> --mirror` do the same from the other two directions. It
blocks until the window is closed, so run it the way you would run
`adb-ai mirror`. On Termux, or anywhere scrcpy is missing, the connection is
still made and reported - only the window is skipped.
`adb-ai` uses the default device when `-d` is omitted. With several devices
connected, pass `-d tv` (an alias) or the serial.
## Driving a device
```bash
adb-ai key home # one key
adb-ai key down down ok # a sequence, in order
adb-ai key volup -n 5 # repeat a key
adb-ai keys # every key name available
adb-ai open netflix # alias, package name, or a fragment of one
adb-ai apps # what is actually installed
adb-ai close netflix
adb-ai youtube "lofi hip hop" # search without fighting the on-screen keyboard
adb-ai url "https://example.com"
adb-ai text "hello there" # type into the focused field
adb-ai volume up -n 3
adb-ai volume set 12
adb-ai off # screen to sleep
adb-ai on # wake
```
## Checking your work, instead of assuming
```bash
adb-ai state # foreground app, screen state, playback state
adb-ai shot out.png # screenshot (reads correctly even on devices that
# print driver noise before the PNG)
```
`adb-ai shot` is your eyes. `adb-ai mirror` is **not**: it opens a live window
on the user's own computer for *them* to watch, and you cannot see it. Offer it
when the user wants to follow along or take over - "want me to put the screen
up in a window while I do this?" - and keep using `shot` yourself. It needs
scrcpy, and it does not work on Termux; if it refuses, say so and carry on with
`shot`.
Prefer `adb-ai state` over a screenshot when a text answer is enough - it is
much faster and cheaper.
## Reading the screen as text, and tapping by name
On a phone or tablet, `adb-ai ui` lists what is on screen - every label,
button and icon description - with the point to tap for each. It is faster
than a screenshot and exact, so use it to find things instead of guessing
coordinates off a picture:
```bash
adb-ai ui --clickable # what can be tapped, and where
adb-ai tap-text "Save" # tap it by its label, at its real centre
```
It is blind to games, video and maps: anything drawn straight onto the screen
shows up as one element with nothing in it. Use `shot` for those.
Reading the layout takes a few seconds on some phones, so tap several labels
on the same screen from one read: over MCP, `adb_steps` with
`{do: "tap_text", text: ["7", "multiplicação", "6", "igual"]}`. Buttons drawn
as symbols are usually labelled only by their description - the list above
shows it.
## Several actions in one call
Over MCP, when you already know the next few actions, send them together with
`adb_steps` instead of one call each: open an app, tap a field, type, press
enter, and get the screen once at the end. It waits for the screen between
steps, stops at the first one that fails and says which. Each call you save is
a round of your own thinking, which is far slower than the device.
```json
{"steps": [{"do": "open_app", "app": "youtube"},
{"do": "tap_text", "text": "Search"},
{"do": "text", "text": "eminem"},
{"do": "key", "keys": ["enter"]}]}
```
## Live view: watching along with the user
`adb-ai live` streams the screen while you work, so you look at frames instead
of asking for screenshots. Where scrcpy runs (Linux, macOS) it shares the
capture of the scrcpy window the user is watching - you both see the same
picture. On Windows and Termux it streams the device's `screenrecord` instead;
there the frame after an action comes from a screencap once the screen is
still, so answers take a second or two longer. It needs ffmpeg; `adb-ai doctor`
says which mode you will get.
While live view runs the device's animations are off, so each action shows at
once; they come back when it stops. Tell the user, since the device looks a
little different meanwhile; `animations: true` on `adb_live` (or
`adb-ai live --keep-animations`) leaves them on.
Through the MCP server it is `adb_live`, then `adb_look` for the newest frame,
`look: true` on any action to get the screen the moment it settles, and
`adb_wait_change` to wait for something to happen on its own. From the shell:
```bash
adb-ai live --out /tmp/screen.jpg & # keeps the newest frame in that file
```
Frames are scaled down; the text that comes with each one says the factor to
multiply by to turn what you see into tap coordinates.
## Privacy
Two details worth knowing:
- Right after launching or switching an app, the foreground may read as
`unknown (transition?)`. Wait a second and check again before concluding the
action failed.
- An app being open does not mean something is playing. `playback: playing` is
the proof that it is.
- `playback: no media session` means **"cannot tell"**, not "nothing is
playing". Many apps never publish a media session - a TV with a film on
screen can report zero sessions. Never tell the user nothing is playing on
that basis: say you cannot tell from the state, and offer a screenshot.
## Working with the user
- **Say what you are about to do before doing it.** These commands act on a
physical device in someone's home: a TV can wake up at 3am and a `close`
loses what was playing.
- **Ask before anything disruptive** when the user has not asked for it
directly: force-stopping an app, putting a device to sleep, or changing the
volume by a lot.
- **Never start a recording quietly.** `adb-ai record` and `adb_mirror` with
`record` write a video of everything that crosses that screen to the user's
disk. Say where the file goes and get a yes first.
- **Use `adb-ai shell` for what the named commands do not cover**, not as a
shortcut around them. `adb-ai open netflix` is clearer and safer than the
equivalent `monkey` line, and it checks the package exists first.
- **Shell is on by default and can change the device.** Reading is fine without
asking - `dumpsys`, `getprop`, `pm list`, `settings get`, `wm size`. Anything
that changes or removes something - `pm uninstall`, `pm clear`, `settings
put`, `rm`, `am force-stop` on an app in use - say what you are about to run
and get a yes first. There is no undo on someone's TV.
- If the shell answers that it is switched off, the owner set `ADBAI_NO_SHELL`.
Do not suggest removing it; work with the other tools.
- **Send a key sequence as one command**: `adb-ai key down down ok`, not three
calls. It is one roundtrip instead of three. If the menu ends up one step
short, the animation ate a key - repeat it with `--pace 120`.
- Respect what the device is for. Opening a streaming app is fine; working
around a paywall, a licence check or someone's account is not.
## A phone is not a TV
When the target is a phone or a tablet rather than a TV or a TV box, the same
commands reach the user's messages, bank and accounts. Treat it that way:
- **Live view on a phone is a continuous screenshot.** Everything that crosses
the screen while it runs - a notification, a chat, a code - reaches you.
Start it only when the user asks for it or agrees, say that it is on, and
stop it (`adb_live` with `action: stop`) as soon as the task is done. Every
rule below about screenshots applies to every frame of it.
- **`adb-ai ui` reads a screen's text the way a screenshot shows it.** On a
chat list or an inbox, that text *is* the user's private content. The same
rules apply: use it on screens you created or the user pointed you at, not
to read through their apps.
- **Ask first** before opening anything personal - messaging, email, banking,
photos, settings - even when the user's request implies it loosely.
- **Do not take screenshots of a phone unless asked**, and say so when you do.
A screenshot can contain a chat, a balance or a one-time code, and it leaves
the device to be processed. Prefer `adb-ai state`, which answers "which app
is in front" in text.
- **Never screenshot a screen that lists the user's own content** - the notes
list, a chat list, the gallery, the call log, a file manager, the
notification shade. Permission to use an app is not permission to photograph
what is already in it. Capture only screens you created yourself: a blank
note you just opened, a calculator you just typed into.
- **To check that something worked, use `adb-ai state`, not a screenshot.** It
answers which app and activity is in front, in text, with nothing personal
attached. Reach for a screenshot only when the question is genuinely visual
and the screen is one you made.
- **To find a button to tap on a personal app, ask the user for the
coordinates** or have them describe the layout, rather than screenshotting a
screen full of their data.
- **Never read or relay a verification code** that appears on screen, and do
not type one into anything.
- **Do not send messages, make purchases or confirm payment dialogs.** If a
task would lead there, stop and hand it back to the user.
- Alarms, timers, volume, opening a media app and pressing play are the
ordinary, expected uses. Stay in that lane unless asked otherwise.
- **An alarm you set cannot reliably be unset.** Most clock apps ignore the
dismiss intents, so deleting is a human's job in the clock app. Set exactly
what was asked for, say that you set it, and do not create extras "to be
safe".