Adb

From ithinkihaveacat/dotfiles · View interactive version

Adb is an AI agent skill from the GitHub repository ithinkihaveacat/dotfiles. Manipulates Android devices via ADB with emphasis on Wear OS and device automation. Provides scripts for screenshots with circular masking, screen recording, tile management, Wear widget tray control (list, clear, .rc document export), WearableService inspection, package operations, and device confi

How to use this skill

Skill file

Android ADB

Using Helper Scripts vs. Raw ADB

Use the scripts in scripts/ as the primary interface for device workflows.

References to scripts/... in this skill are relative to this skill directory.

They encapsulate solutions to common Android and Wear OS platform quirks:

When to use raw adb: For general diagnostic inspection not covered by

these scripts (e.g. adb logcat, adb shell pm list), or when building custom

pipelines, standard adb commands are appropriate. If a helper script fails or

lacks a specific flag you need, inspect its source in scripts/ to understand

the underlying dumpsys or input sequence and adapt it.

Quick Start

When multiple devices are connected, pass -s SERIAL or --serial SERIAL

before other arguments to any skill script. The flag overrides ANDROID_SERIAL;

the environment variable remains available for persistent or inherited device

selection.

Highest-Value Commands

scripts/adb-screenshot

scripts/adb-tile-add com.example/.MyTileService -> output gives INDEX

scripts/adb-tile-switch INDEX

adb exec-out dumpsys activity service WearableService

scripts/adb-wear-pair (or scripts/adb-wear-pair --status to inspect

pairing state)

scripts/packagename dumpsys PACKAGE_NAME (manifest components),

scripts/packagename services PACKAGE_NAME (active/running services)

TV, settings activities across user apps or for a specific package)

Script Index

See references/command-index.md for detailed usage.

Device Basics

manufacturer, API level, display size, etc.).

For simple one-shot operations (listing device serials, waking or sleeping the

device, filtering logcat by tag, sending VIEW intents, toggling "Show touches"),

use raw adb commands. See

references/command-index.md for

the exact invocations, including non-obvious flags.

Media Capture

adb shell screencap.** Features: auto-detects square Wear OS displays and

applies circular mask, wakes device before capture by default (pass

--no-wake to preserve Wear OS Ambient / Always-On Display state), copies to

macOS clipboard, generates timestamped filenames by default.

devices that require raw frame streaming (e.g., Samsung Wear OS watches) and

uses ffmpeg for capture, while defaulting to scrcpy for standard devices.

Tile Management (Wear OS)

--type FULLSCREEN|LARGE|SMALL (default LARGE) for services declaring

BIND_WIDGET_PROVIDER (Glance widgets); FULLSCREEN produces a full-screen

tile.

carousel, or remove tray widgets by ID, component, or --all with

--vertical.

carousel.

(.rc) and print its rendering context as JSON.

via DEBUG_SYSUI.

With --vertical, adb-tile-add, adb-tile-remove, and adb-tiles target the

standalone renderer's vertical carousel (WidgetTrayActivity, .emu, .exp,

and .dev renderer flavors) instead of the SysUI carousel (--vertical

supports only LARGE and SMALL container types). Tray widgets are addressed

by numeric widget ID (starting at 10001, up to 25 widgets) or component

name:

scripts/adb-tile-add --vertical --type LARGE com.example/.MyWidgetService
scripts/adb-tiles --vertical            # => 10001 LARGE com.example/.MyWidgetService
scripts/adb-tile-remove --vertical --all  # reset the tray before a capture
scripts/adb-tile-dump -o widget.rc 10001 > widget.meta.json

adb-tile-remove --vertical <ID|COMPONENT> work on all tray-capable renderer

builds (including the 1.6.5.41.* .emu renderer bundled in the Wear OS 7.1

Beta RC1 emulator; on .emu builds where Log.d is stripped by ProGuard,

adb-tile-add --vertical checks for post-render Log.e / crash failures

without timing out on Log.d). By contrast, adb-tiles --vertical,

adb-tile-remove --vertical --all, and adb-tile-dump require a renderer

build with GET_WIDGETS / DUMP_RC_DOC (>= 1.6.6.13) and exit with a clear

version message on older .emu builds. adb-tile-dump also requires root

(adb root on userdebug emulators or su on userdebug devices) to read

the cached .rc file; user builds cannot export .rc files.

[!NOTE] Tile Indexing (Index=[0]): When adding a new tile using

scripts/adb-tile-add, the output often indicates Index=[0]. This means the

tile was added to the first position in the carousel, pushing existing

tiles down. It does _not_ mean it has overwritten previous tiles.

Verifying Installed Tiles: Use scripts/adb-tiles to list all installed

tiles and see which ones are currently in the carousel. The output uses

prefixes like UTWC where C indicates it is in the carousel.

Activity Discovery

TV/Leanback, Settings), optionally filtered to a single PACKAGE. Use

--launcher-only, --tv-only, --settings-only to filter by category, or

--all to include system apps.

timeout and --compressed fallback so animated screens do not hang.

UI toolkit (--toolkit, --details, --json).

Package Operations

uninstall, clear-cache, pull, tiles, dumpsys for manifest

components, services for running services, logcat, jobscheduler).

System & Dumpsys

(google_apis / google_apis_ps16k userdebug) with a Wear OS emulator over

TCP port 5601, or inspect current pairing status (--status).

Display & Demo Mode

fixed clock, show touches, long screen timeout.

set default|large|NUMBER).

'lemongrass'). Requires Wear OS 6+ (API 36+).

root/debuggable build).

Safety Notes

OS debug broadcasts (com.google.android.wearable.app.DEBUG_SURFACE) which

may not work on production builds without developer options or specific system

images. Standard unrooted adb shell runs as uid=2000

(com.android.shell), so non-exported components and

signature/signatureOrSystem-protected receivers reject am broadcast

unless elevated via adb root or su 0.

--vertical --all, which empties the widget tray) or packagename uninstall

modify device state.

Reference Material

references/command-index.md.

bug reports. See

references/bug-report-capture.md.

and Wear OS quirks. See

references/troubleshooting.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.