Connect a Device¶
Get your phone talking to adb. Three modes: USB, wireless, SSH-over-adb.
Mode 1: USB (simplest)¶
- Enable Developer Options:
Settings → About phone → tap Build number 7 times - Enable USB debugging:
Settings → System → Developer options → USB debugging - Plug in USB cable. Accept the trust dialog on the phone.
- Verify:
unauthorized?
If adb devices shows unauthorized, unlock the phone and accept the dialog. Still stuck? adb kill-server && adb start-server.
Mode 2: Wireless adb (no cable after pairing)¶
Android 11+ supports native wireless debugging.
Pair once¶
Settings → Developer options → Wireless debugging→ toggle on- Tap Pair device with pairing code — note the IP, port, and 6-digit code.
- On your host:
Connect¶
Make it stick¶
Add to ~/.zshrc / ~/.bashrc:
→ Details: SSH_ANDROID.md
Mode 3: SSH over adb (remote agent → phone)¶
You want your DevDuck running on a remote box (Jetson, VPS) to control a phone sitting on your desk. Two subsolutions:
3a. adb over SSH tunnel¶
On the host with the phone:
On the remote box:
3b. adb running on the phone itself (Termux)¶
Install Termux on the phone, then:
SSH into the phone from your agent's host, run commands there.
→ Full walkthrough: SSH_ANDROID.md
Multi-Device Targeting¶
Got more than one phone connected?
Option A: Set a default globally¶
All adb(...) calls will target that device unless overridden.
Option B: Per-call override¶
Option C: Let the agent choose¶
agent("list all connected devices, then take a screenshot of the Pixel")
# Agent calls list_devices → sees serials + models → picks the right one
Custom adb Binary¶
If adb is not on PATH (or you want a specific version):
Troubleshooting¶
| Symptom | Fix |
|---|---|
adb: command not found |
Install android-platform-tools (see Installation) |
device unauthorized |
Accept the USB debug dialog on the phone |
no devices after reboot |
adb kill-server && adb start-server |
| Wireless drops after suspend | Reconnect with adb connect IP:5555 (script it) |
| Screenshot is black | Phone is locked — try adb(action="wake") first |
Permission denied on push |
Target a world-writable path like /sdcard/ |
What's Next¶
- Quickstart — first queries
- Actions Overview — full capability list
- DevDuck Integration — production setup