Generated from contracts/proto/*.proto by protoc-gen-doc. The narrative
contract — run liveness, the pool, sessions, status mapping — is in the repository's
.docs/server-api.md.
false: only the package may handle it (-p), so no chooser can appear. true: Android resolves it as a tapped link would — another app, the browser, or a chooser.
The app's own languages (cmd locale set-app-locales, API 33+; FAILED_PRECONDITION, UNSUPPORTED_API below), BCP-47 tags in preference order; empty = follow the system. Read back after the change; restored on detach like the device conditions.
am start -W of the launcher intent, as the home screen does: the app's existing task comes back as it was left; with no task, the launcher activity starts.
Normalized relative UTF-8 path under credential-encrypted private data. No absolute paths, empty components, . or .., control characters or symlink components. Empty lists root only.
Database first, optional WAL/journal; at most 3 files and 64 MiB total. Stage all bytes before replacement. Discard old sidecars, including SHM. Never launch. Multi-file replacement is not an OS transaction: an interrupted commit can require repair.
Public device/app operations, with separate variants where prerequisites differ. SDK
composites (back/home, wake/sleep, background, scroll-until, capture) use these primitives.
App-private-data discovery stays on AppDataService.GetCapabilities; synchronization,
connection/inventory, watcher and event-log services are outside this catalog.
Eligibility, not a promise of success: matching, occlusion, Android acceptance and transport
checks remain authoritative. No automatic fallback, skip, preflight or mutation is implied.
Pick variants: exactly one match (default; more is AMBIGUOUS), the first in accessibility
order, or the zero-based index-th in accessibility order (NOT_FOUND when absent).
A View resource id. With package_name: exactly package_name:id/name. Without: name in any
package (<any>:id/name) or the bare name, which is how a Compose testTag appears under
testTagsAsResourceId. name never contains :id/; put the package in package_name.
A complete selector: the node tree and how an action picks among matches. Package ownership
is an ordinary PROPERTY_PACKAGE_NAME predicate; there is no separate execution scope.
Built by the client DSLs and validated identically by the server and the driver.
Editable text (AccessibilityNodeInfo.isEditable), whatever its class. UiAutomator's BySelector has no such predicate, so a selector with it is matched by walking the tree (as regex is).
A crash or ANR of an app on the attached device, as Android logged it (am_crash / am_anr
in the events buffer, the stack trace from the crash buffer). Recorded by the host server.
Crash: the crash buffer's lines for the process (FATAL EXCEPTION and its stack, or the native tombstone summary), at most 32 KiB; empty when they scrolled out or never came. ANR: empty.
Whether the package was watched (started through the attachment, or named by a command's selector) before it died. Only watched deaths explain failures and end waits.
Whether a client already has it: a command's error on this attachment carried it (Error.app_death), or a client took it (AcknowledgeAppDeaths). A handled death explains no later failure and ends no wait.
Waits for a toast. text (≤ 1024 chars) is compared under mode (default exact); absent =
any text. package_name absent = a toast from any package. A toast posted up to 3.5 s before
the command (the longest one stays up) counts.
Taps the dialog's button for choice; it must be offered, exactly once.
With accuracy, the dialog's radio for it is selected first; it must be offered too (both are
found before any input). UNSPECIFIED leaves the accuracy as the dialog shows it.
One protocol request minus session identity (the server owns session id, generation and
request ids). Exactly one op must be set; its case name is the protocol op.
The display conditions are read where a change lands first, so a read right after a change or its restore sees it: dark mode, density and locales from the system's configuration, font scale and bold text from their settings. Running apps receive changes later.
the system configuration is night (UI_MODE_NIGHT_YES) |
| font_scale | float | | Settings.System font_scale |
| density_dpi | int32 | | the system configuration's densityDpi |
| airplane_mode | bool | | Settings.Global.AIRPLANE_MODE_ON |
| wifi_enabled | bool | | Settings.Global.WIFI_ON is 1, or 2 (on under airplane mode) |
| mobile_data_enabled | bool | | Settings.Global mobile_data; false without telephony |
| system_locales | string | repeated | the system configuration's LocaleList, as BCP-47 tags |
| stay_awake | bool | | Settings.Global.STAY_ON_WHILE_PLUGGED_IN is not 0 |
| high_contrast_text | bool | optional | Settings.Secure high_text_contrast_enabled / accessibility_display_inversion_enabled; absent when Android does not let the driver read them. |
| color_inversion | bool | optional | |
| bold_text | bool | | Settings.Secure font_weight_adjustment > 0 (API 31+; false below) |
| driver_uid | int32 | | The Linux uid the driver runs as: how the daemon tells the driver's own log lines (the actions it ran, device_log.proto) from an app's that use the same tag. |
| show_ime_with_hard_keyboard | bool | optional | Settings.Secure show_ime_with_hard_keyboard: the soft keyboard shows while a hardware keyboard is connected. Absent when Android does not let the driver read it. |
An active notification: the package that posted it, its title and text (Notification extras
android.title / android.text, absent when it has none), the titles of its action buttons,
whether a swipe can dismiss it, and when it was posted (wall clock, epoch milliseconds).
Dismisses the one matching notification as a swipe does. NOT_FOUND / AMBIGUOUS, or
ACTION_REJECTED (NOT_CLEARABLE) for an ongoing one, before anything changes.
Press and hold on selector's centre until it becomes a long press, move to target's centre,
hold there, release: one gesture. Both resolve to exactly one element before input starts.
The node is showing its hint: on API 26+ an empty field then reports the hint as text. text is always the raw accessibility text; selectors match that same raw text.
A failed command. Driver-side failures and driver-transport loss are data (including
TRANSPORT_LOST / INDETERMINATE with detail = transmission state), never a gRPC error:
gRPC status codes are reserved for the client↔server call itself.
WAIT_TIMEOUT / STATE_NOT_REACHED of wait_state, read from the same node as last_state: whether each operand of the condition's top-level all_of (or any_of) holds, in order; one entry when the condition is neither.
NOT_FOUND of a targeted command, and WAIT_TIMEOUT / NO_MATCH of wait_visible / wait_state: which part of the selector ruled the nodes out, read once after the failure.
Counted taps at the same initially resolved centre. No lookup or retry between taps.
count: 1..100; interval_ms is the gap between release and the next press, 40..1000
(default 100). Including each 50 ms tap, the whole sequence must fit within 30000 ms
and the remaining command deadline. An older implementation rejects this operation.
Up to 3 distinct values that nodes matching every other operand have for this operand's property (text, content description, hint, class, package or resource name), at most 100 characters each. Empty for flags and relations, and when without is 0.
Which notifications a notification op means; every field given must match (none: any).
package_name exactly; title and text (≤ 1024 chars each) under mode (default exact).
The notifications are what a NotificationListenerService in the driver app sees: the server
gives the driver notification access (cmd notification allow_listener) before the first
notification op and takes it back on detach. Group summaries are left out.
Opens the one matching notification as a tap on it in the shade does: sends its content
intent and, when it auto-cancels, removes it. With action (≤ 1024 chars), sends the intent
of its action button with exactly that title instead, and the notification stays. NOT_FOUND /
AMBIGUOUS, or ACTION_REJECTED (ACTION_NOT_OFFERED) when it has no content intent or no such
action, before anything is sent.
How the panel was found and where it is, e.g. pane "Navigation menu" [0,42][420,1396] or window "Popup Window" [150,651][570,828], plus the side.
An accessibility action on the one matching node, as a screen reader performs it (no touch,
so no occlusion check): a standard action, or a custom one by its exact label (≤ 1024 chars).
The node must offer it: ACTION_REJECTED (ACTION_NOT_OFFERED) before input otherwise.
The runtime-permission dialog on screen: the package of its window (what a selector's package
scope names; Google builds rename the controller, so it differs from the resource ids' package)
and the choices it offers, in PermissionChoice order.
An Android KeyEvent key code (≥ 0), pressed count times, interval_ms from each release to the
next press. Without a hold each press is a down and an up at once. long_press (true) holds each
press for the device's long-press timeout and sends the repeat Android marks as a long press
(FLAG_LONG_PRESS); duration_ms holds it that long, with the key repeats a held key sends. The
whole sequence must fit in 30000 ms, a long press counted at LONG_PRESS_WORST_CASE_MS (1500,
the longest long-press timeout Android offers).
Reads the driver's bounded toast history, oldest first, without waiting or consuming it.
A different nonempty stream_id reports reset and returns the new stream from its beginning.
Mock location: the gps and network providers (and fused, API 31+) report this fix, as
LocationManager test providers the driver owns, sent again every second until the driver
stops or the next set_location. latitude -90..90, longitude -180..180, accuracy_m > 0
(default 5 m), altitude_m absent = no altitude. The driver app needs the mock-location app-op
(the host's DeviceService.SetLocation grants it first); without it Android refuses
(ERR_ACTION_REJECTED).
ACTION_SET_PROGRESS on the one matching range node (SeekBar, Slider, RatingBar): value in
the node's own RangeInfo units, finite and within its min..max. A node without the action or
a value outside the range is ACTION_REJECTED (ACTION_NOT_OFFERED / OUT_OF_RANGE) before input.
sensitive (a password, a token): the daemon logs the command without its text, so the
per-connection event log, tap-watcher and exports never hold it. The driver ignores it.
Read all currently exposed matches in one lookup, in accessibility order (window order,
then post-order within each window), not visual or dataset order. No implicit scrolling or
waiting. The selector must not have first/at. Empty matches succeed with an empty list.
Reads are not an atomic UI transaction. A stale read fails the whole command; no partial
results. More than 1000 matches or an ElementSnapshotList over 1 MiB is PAYLOAD_TOO_LARGE.
A tap outside the panel that holds the selected element: a dialog, popup, menu, drawer or
bottom sheet. The selector names any node inside the panel (its title, a row). The panel is
the nearest node from the selected one up that offers ACTION_DISMISS or has a pane title
(drawers, bottom sheets, both Views and Compose); the touch then goes beside it, inside its
nearest larger ancestor, where no actionable node other than a scrim would take it.
Otherwise, or with no such side, the panel is the node's window, and the touch goes past its
frame by the window touch slop plus 8 dp. Sides are tried below, above, right, left; a point
on the system bars or gesture area, the keyboard or a window above the panel is skipped. Refused before input with
NOT_INTERACTABLE / NO_OUTSIDE_POINT when no side has room (a full-screen window that is not a
panel), or / TOUCH_REACHES_BELOW when every free point is in another app window below the
panel (a panel that lets touches through) and allow_reach_below is false. Whether the panel
closed is the app's choice and the test's to check. Default display only. An older
implementation rejects this operation.
A physical press held for duration_ms (1..30000), then released. This is not an
accessibility long-click; short durations may not trigger the app's long-press handler.
Key events for text (≤ 256 chars) into whatever has input focus; no target, no click.
Clients tap the field first (the SDKs' element typeText does). sensitive as for SetText.
Waits until the one node selector resolves to satisfies condition: the selector picks the
node (exactly one match, or its first / at pick), then condition is evaluated on that node
alone, as a selector predicate would evaluate it, so a pick keeps choosing among the selector's
matches and never among the nodes that satisfy the condition. No match yet, or a tree changing
under the read, keeps polling; several matches without a pick fail at once with AMBIGUOUS
(there is no one node to wait for). A timeout is WAIT_TIMEOUT with STATE_NOT_REACHED,
Error.last_state and Error.condition_holds (both read from one final lookup), or NO_MATCH
when that lookup resolved no node. The selector and the condition share the selector size limit.
Closed error taxonomy shared with the device protocol; Error.detail refines it with a
stable sub-reason. See the errors guide for meaning, mutation risk and retryability.
Name
Number
Description
ERR_UNSPECIFIED
0
ERR_INVALID_REQUEST
1
ERR_INVALID_SELECTOR
2
ERR_UNSUPPORTED
3
ERR_UNAUTHENTICATED
4
ERR_SESSION_MISMATCH
5
ERR_DUPLICATE_OR_STALE
6
ERR_OVERLOADED
7
ERR_AUT_MISMATCH
8
ERR_NOT_FOUND
9
ERR_AMBIGUOUS
10
ERR_NOT_INTERACTABLE
11
ERR_STALE_DURING_COMMAND
12
ERR_ACTION_REJECTED
13
ERR_WAIT_TIMEOUT
14
ERR_CANCELLED
15
ERR_DEADLINE_EXCEEDED
16
ERR_AUT_NOT_INSTALLED
17
ERR_AUT_CRASHED
18
ERR_AUT_ANR
19
ERR_SYNC_PROVIDER_UNAVAILABLE
20
ERR_DRIVER_UNHEALTHY
21
ERR_TRANSPORT_LOST
22
ERR_INDETERMINATE
23
ERR_ARTIFACT_TRANSFER_FAILED
24
ERR_PAYLOAD_TOO_LARGE
25
ERR_INTERNAL
26
ERR_UNKNOWN
27
ERR_STALE_BEFORE_INPUT
28
The resolved node went stale (its view was detached or replaced) before any input was sent.
A button of the runtime-permission dialog, by what it grants. Which ones a dialog offers depends
on the permission, the Android version and the controller build (wait_permission_prompt).
Name
Number
Description
PERMISSION_CHOICE_UNSPECIFIED
0
PERMISSION_ALLOW
1
"Allow"
PERMISSION_ALLOW_FOREGROUND_ONLY
2
"While using the app"
PERMISSION_ALLOW_ONE_TIME
3
"Only this time"
PERMISSION_ALLOW_ALWAYS
4
"Allow all the time" (API 29 background location)
PERMISSION_ALLOW_SELECTED
5
"Select photos and videos" (API 34 partial media access)
PERMISSION_ALLOW_ALL
6
"Allow all" (API 34 media)
PERMISSION_DENY
7
"Don't allow" / "Deny"
PERMISSION_DENY_AND_DONT_ASK_AGAIN
8
"Deny & don't ask again"
PERMISSION_KEEP_FOREGROUND_ONLY
9
"Keep while app is in use" (an upgrade request refused)
PERMISSION_KEEP_ONE_TIME
10
"Keep only this time" (an upgrade request refused)
A standard accessibility action that takes no arguments (AccessibilityNodeInfo.AccessibilityAction),
as a screen reader performs it. Click and long click are not here: tap / long_tap touch.
A bug in the daemon or host core (INTERNAL). Report it with the daemon log.
FAILURE_REASON_INVALID_ARGUMENT
2
Caller input the daemon rejects before doing anything (INVALID_ARGUMENT).
FAILURE_REASON_UNAUTHENTICATED
3
Missing or wrong daemon token (UNAUTHENTICATED).
FAILURE_REASON_UNKNOWN_CLIENT_CONNECTION
4
The client_connection_id is not (or no longer) known (NOT_FOUND).
FAILURE_REASON_UNKNOWN_ATTACHED_DEVICE
5
The attached_device_id is not (or no longer) attached (NOT_FOUND).
FAILURE_REASON_NOT_OWNER
6
The device is attached by another client connection (PERMISSION_DENIED).
FAILURE_REASON_DEVICE_BUSY
7
Another session holds the device's lock: FAILED_PRECONDITION without a wait, DEADLINE_EXCEEDED after waited_ms.
FAILURE_REASON_DEVICE_QUARANTINED
8
The device's journal keeps it out of service until an explicit reset (FAILED_PRECONDITION).
FAILURE_REASON_HOST_WAIT_TIMEOUT
9
A host-side wait (app process, window, idle) ran out of time (DEADLINE_EXCEEDED).
FAILURE_REASON_ADB_TIMEOUT
10
An ADB command did not finish within its timeout (DEADLINE_EXCEEDED).
FAILURE_REASON_ADB_FAILED
11
An ADB command failed, or is gated by an earlier unreaped one (UNAVAILABLE).
FAILURE_REASON_ADB_REAP_UNCERTAIN
12
An ADB command left an uncertain residual; the device may have changed (FAILED_PRECONDITION).
FAILURE_REASON_APP_LIFECYCLE
13
An app lifecycle postcondition did not hold (FAILED_PRECONDITION).
FAILURE_REASON_DRIVER_BUILD_MISMATCH
14
The installed driver is not the build this daemon expects (FAILED_PRECONDITION).
FAILURE_REASON_DRIVER_START_FAILED
15
The driver could not be started or authenticated (UNAVAILABLE).
FAILURE_REASON_DRIVER_TRANSPORT
16
The driver connection was lost around a host-issued command (UNAVAILABLE).
FAILURE_REASON_DRIVER_COMMAND
17
A host-issued driver command (for example attach's device info) failed with error_code (FAILED_PRECONDITION).
FAILURE_REASON_SESSION_UNUSABLE
18
The session can no longer run operations: detach and attach again (ABORTED).
FAILURE_REASON_DAEMON_PRECONDITION
19
The daemon cannot serve the request in its current state (FAILED_PRECONDITION).
FAILURE_REASON_UNKNOWN_REF
20
The ref is not in the attached device's latest screen snapshot (NOT_FOUND).
FAILURE_REASON_REF_NOT_ADDRESSABLE
21
The ref's node had no selector that matched it alone (FAILED_PRECONDITION).
FAILURE_REASON_UNSUPPORTED_API
22
The device's API level is below what the call needs; detail names it (FAILED_PRECONDITION).
FAILURE_REASON_DEVICE_SETTING
23
The device did not take a setting: it read back another value (FAILED_PRECONDITION).
FAILURE_REASON_DEVICE_FILE
24
A device file Tap cannot write or read as asked: it exists and is not this session's, its directory is missing, it is not a regular file, or it did not read back (FAILED_PRECONDITION).
FAILURE_REASON_APP_DATA
25
Debuggable-app data access was refused or failed (FAILED_PRECONDITION). detail distinguishes RUN_AS_UNAVAILABLE, APP_RUNNING, SYMLINK, EXISTS, NOT_FOUND, LIMIT or IO_ERROR.
FAILURE_REASON_UNKNOWN_LOG_MARKER
26
No marker with that name was written to the attachment's log (NOT_FOUND).
An AppService call. operation is the RPC in snake_case: install, uninstall, force_stop,
clear_data, grant_permission, revoke_permission, launch, cold_launch, foreground, open_link,
set_locales.
Host boundaries around the validated RPC block, including queued/transport work. Not device input/capture times. Compare with video receipt only when clock_id matches. Missing on events from older daemons; never derive these from epoch timestamps.
Present: a held connection. It needs no Observe stream (opening one is FAILED_PRECONDITION) and ends on Disconnect, daemon shutdown, or idle_timeout_ms after the last call that named it. Its name must be non-blank and unique among held connections (FAILED_PRECONDITION).
Optional administrative reason, at most 512 characters, no control characters. Empty retains "client request". Recorded in lifecycle logs and sent to Observe.
Serial -> cleanup failure/timeout. The connection is closed even when cleanup is uncertain; normal journal recovery/quarantine rules still apply. Empty means no reported cleanup issue.
tap.v1 compatibility epoch, from contracts/proto/API_COMPATIBILITY. Nonzero and equal on client and server; increment for breaking API changes, not additive fields or releases. Zero means an older daemon that cannot establish compatibility.
Allowlisted effective startup options (no credentials), for inspection and explicit restart. Empty on embedded daemons not launched by the CLI or on older servers.
Long-lived stream the client keeps open for the life of the connection; it must be opened shortly after Connect. Its end is the liveness signal: the stream ending (either side) disconnects the client. The first event is observing; a daemon-initiated disconnect sends closing and then completes the stream normally.
The connection's event log (event_log.proto) after after_seq. Kept for every connection, the last 2000 events; renews a held connection like any call naming it.
tap.v1 — live accessibility events from an attached device (DeviceService.WatchDeviceEvents).
Events are hints that the screen changed, not authoritative UI state: Android merges and drops
them, and they carry no node handle. A client that reacts to one re-reads the screen through
a selector. Watching is read-only: subscribing changes nothing on the device.
Text fields are at most 512 characters (longer text is cut), class names at most 256. A text
field can hold what the user typed; Android masks a password field's text itself.
Increases by one per event the driver forwards on one driver connection; a gap between two a subscription receives means only that other events were not of its types or package.
Events the driver dropped before this batch because the host did not read fast enough. On the server API it is always 0: a loss ends the stream with RESOURCE_EXHAUSTED instead.
An editable view's text changed (TYPE_VIEW_TEXT_CHANGED): raised for typed input, once per key.
Text set in one step (the set-text accessibility action, set_text) is a ContentChanged with
TEXT instead, on the devices checked.
What changed about a window. STATE is TYPE_WINDOW_STATE_CHANGED (an activity, dialog, popup
or pane appeared or changed state); the rest are TYPE_WINDOWS_CHANGED flags (API 28+).
Attach a QUARANTINED device to inspect and fix it (an agent or person deciding whether to unquarantine it). Without it a quarantined device is refused (DEVICE_QUARANTINED). The attachment works as usual, starting with the quarantine's unrestored saved state, and Detach puts the device back in QUARANTINED for the same reason; only Unquarantine lifts it. A quarantine waiting for a reboot reset is still refused. A free device attaches as usual.
Read the device's logcat for the whole attachment (device_log.proto); absent = true. False: no logcat child runs, DeviceLogService is FAILED_PRECONDITION and DeviceLogs reads the device's ring buffers at the time of the call.
What the device is, for choosing one (tap_devices(left={"min_api": 30})). Set for an online device whose properties the daemon could read; absent for offline, unauthorized or unreadable ones.
QUARANTINED only because device settings a session saved did not read back after it put them back (another writer changed one again, ADB failed mid-restore); nothing else about the device is unproven. Attach (and tap doctor --fix) stops any leftover driver, writes them again and goes ahead once they read back; if they still do not, it fails DEVICE_QUARANTINED.
QUARANTINED, and attached with inspect_quarantined by a live session (its client_connection_id when that is one of this daemon's): someone is looking at it.
The main, system and crash buffers since the attachment opened, redacted, as text lines. With log capture on (the default) it is the captured log (device_log.proto): nothing has scrolled out of the device's buffers, and the markers and Tap's actions are lines of their own (──). Otherwise logcat -v threadtime at the time of the call (device clock, one second early; the whole buffers when the clock was unreadable), where what scrolled out of the ring buffers is gone. Longer than 4 MiB keeps the newest lines.
Since the attachment: the crash buffer (Java FATAL EXCEPTION, native crashes) and the am_crash / am_anr events. Empty when nothing crashed or stopped responding.
First wait until this long after the attachment's latest input (a mutating command or an app call) ended, because Android logs a crash 10–200 ms after the input that caused it. No wait when that has passed, when no input was sent, or when no package is watched. 0 to 5000.
When no death after after_sequence is recorded yet (of any app), first wait up to this long for one, or until the attachment ends (the call then fails, the device being unknown). 0 to 600000. A waiting call does not count as use of a held connection: a background waiter never keeps an idle session alive.
The node accepts input of its own: editable, clickable, long-clickable, checkable or scrollable, or it offers a custom action or a standard action that acts on it (expand, collapse, dismiss, scroll or page, context click, press and hold, cut, paste). Focus, selection, copy and show-on-screen alone do not count. Decided from the node, never its class.
Only with ScreenSnapshotRequest.selector_candidates: every selector that matched only this node, best first (the first is selector). A candidate that merely adds predicates to an earlier one is left out, and a BY_INDEX pick is offered only when nothing else is unique.
The display at dump time, as rotated: pixels and density (dpi); 0 when the driver did not report them. With a node's bounds they say how big a window is on this screen.
A bounded artifact: video is H.264 MP4, audio is Opus, combined is Matroska (H.264+Opus).
Clients select tracks at Start; Stop returns their one muxed file (never two scrcpy children).
Empty means no audio. "output" (Android 11+; mutes the device speakers), "playback" (Android 13+; keeps local playback, apps can opt out) or "mic" (the device microphone).
What a window is. 1..6 are Android's AccessibilityWindowInfo types; STATUS_BAR and
NAVIGATION_BAR are the SYSTEM windows of com.android.systemui that run along one whole edge of
the display and are at most 64 dp thick (status bars are 24 dp, taller around a camera cutout;
navigation bars 48 dp). The shade, a volume panel or a system dialog stays SYSTEM: on API 29 the
shade is the status-bar window grown to full screen, a volume panel does not span the edge, and
a dialog is thicker. Window titles are not used: the status bar has none and the others are
translated. UNSPECIFIED: the driver did not say.
Puts a QUARANTINED device back in service, by serial, for a person who has checked it (or an agent acting for one); tap unquarantine does the same. It retries the cleanup the session could not prove (stops the driver, removes Tap's port forwards, writes back the settings the journal still holds), then closes the journal whatever the retry managed: the response says what is still off. Needs no client connection. A device another session holds is refused (FAILED_PRECONDITION, DEVICE_BUSY); one ADB cannot reach is refused before anything changes.
Read-only support discovery; never starts operations or changes device state. Requires the owning attachment, like Execute. Not a guarantee that a specific invocation succeeds.
Live accessibility events of the requested types (device_event.proto): a ready response once subscribed, then batches as they arrive. No history: events from before ready are never sent. Read-only; cancelling the call unsubscribes. The stream completes when the device is detached, ends ABORTED (SESSION_UNUSABLE) when the driver connection is lost and RESOURCE_EXHAUSTED when events were lost (the reader fell behind or the driver's buffer overflowed); at most 64 streams per attached device, RESOURCE_EXHAUSTED beyond.
The device's own record since the attachment opened, for failure evidence: logcat, the crashes and ANRs, and the activity and window state now. Diagnostic only, not logged.
The crashes and ANRs Android logged since the attachment opened, oldest first (at most the newest 256). Read from the server's record, not the device; not logged.
Marks deaths handled (AppDeath.handled): the client took them (a block that caught or expected them, an end-of-test check), so they explain no later failure. Unknown sequences (never recorded, or evicted) are ignored.
A compact, ref-addressed outline of the screen, parsed from the diagnostic hierarchy dump (.docs/agent-surface.md). Refs name selectors the daemon synthesised, never node handles.
The selector a ref of the latest snapshot names. Unknown ref: NOT_FOUND (UNKNOWN_REF); a node with no selector: FAILED_PRECONDITION (REF_NOT_ADDRESSABLE).
Device-wide conditions. Each changed value is captured before the session's first change of it, journaled, and restored when the device is detached (or by the next attach when the daemon died first); a restore that cannot be proven quarantines the device. Every change is read back: a value the device did not take is FAILED_PRECONDITION (DEVICE_SETTING). The three animation scales (window, transition, animator duration): all 0 or all 1.
Airplane mode (cmd connectivity airplane-mode), Wi-Fi (svc wifi) and mobile data (svc data): the real switches, nothing mocked. API 29+. Airplane mode is written first; all three are captured on the first change and restored airplane mode first. A device reached over ADB on the network refuses Wi-Fi off / airplane mode on (FAILED_PRECONDITION).
The device-wide locale list (Settings › Languages), 1 to 16 BCP-47 tags in preference order (INVALID_ARGUMENT otherwise). Android has no shell command for it: the driver app applies it as Settings' language picker does, and it is read back (system_locales).
Mock location: the device reports this fix from its location providers until detach. latitude -90..90, longitude -180..180, accuracy_m > 0 (default 5), altitude_m finite (INVALID_ARGUMENT otherwise). The driver app becomes the mock-location app (its android:mock_location app-op) and location is turned on when it is off; both are captured and restored on detach, which ends the mock. The driver serves the fix (set_location).
Keeps the screen on while the device is plugged in (USB, AC or wireless): Settings.Global stay_on_while_plugged_in 7, or 0. Captured and restored on detach.
Shows the soft keyboard while a hardware keyboard is connected (Settings › Physical keyboard › Show on-screen keyboard): Settings.Secure show_ime_with_hard_keyboard 1, or 0. Input methods that follow it hide the soft keyboard while a hardware keyboard is connected unless it is 1; whether one does is up to the input method. Captured and restored on detach.
The accessibility display settings: high-contrast text, color inversion and bold text (API 31+, else FAILED_PRECONDITION / UNSUPPORTED_API before anything changes), as Settings › Accessibility writes them. At least one must be set. Captured and restored on detach.
Files. The bytes travel in the call (never a path on the server's machine), at most 512 MiB. A file Tap cannot write or read as asked is FAILED_PRECONDITION / DEVICE_FILE.
Copies a file to device_path (absolute, normalised; its directory must exist): a PushFileHeader first, then the bytes. A file already there is refused unless this attached device pushed it; the size is read back. Pushed files are deleted on detach. |
| PullFile | PullFileRequest | PullFileResponse stream | Streams the regular file at device_path back in chunks. |
| AddMedia | AddMediaRequest stream | AddMediaResponse | Adds a photo or video to the gallery: an AddMediaHeader (file_name with a photo or video extension), then the bytes. Written to /sdcard/Pictures/Tap/ or /sdcard/Movies/Tap/ and indexed by the media scanner (read back); a name already there is refused unless this attached device added it. Deleted, and dropped from the index, on detach. |
Something Tap did on the device: one entry when it starts, one when it finishes.
A command the driver runs (a tap, typed text, a wait) is logged by the driver itself into the
device log, so its entries are ordered exactly among the app's lines. Queries (exists,
count, snapshot, …) are left out. A call the host runs over ADB (an app launch, a device
setting) is written by the daemon when the call starts and ends, so it sits within a few
milliseconds of the app's lines.
Steps: a client may send the header tap-step: <id> (1 to 64 of A-Z a-z 0-9 . _ -) with any
DeviceService, AppService or AppDataService call; a malformed one is INVALID_ARGUMENT. The id is
copied to the action entries the call caused and to its LoggedEvent.step.
The step the client ran it in: what the call that caused it carried in its tap-step header. A client that records its own steps (an agent's commands, a test's lines) stores the same id with each step and matches the two by it. Absent when the call carried none.
The daemon's monotonic clock when it got the entry: the clock of LoggedEvent.started_monotonic_ns and VideoFrame.received_monotonic_ns, comparable only with values of the same daemon (WatchLogResponse.clock_id).
Package names observed for this uid while the device was attached, including shared uids. Saved with the line; historical reads never substitute a later attachment's package map.
The newest tail entries that pass the filters (1 to 100000). A selected tail over 16 MiB is RESOURCE_EXHAUSTED; request fewer entries or narrower filters.
The filters below apply to log lines only: markers, actions and gaps always pass. Lines of these apps only (by the uid Android gave each package). A package that is not installed is INVALID_ARGUMENT.
Only the entries from the first action of this step to its last (LogAction.step), both included; nothing when the log has no action of that step. Not with follow.
How many entries of the requested range the daemon no longer has (retention removed them), counted before the filters. Add it up over all batches: a recording can keep entries on both sides of a removed stretch. 0 for tail.
Regular expressions (java.util.regex syntax), 1 to 64 per attachment, each at most 512 characters. A match is replaced whole; a pattern with a capturing group has only its first group replaced. Redacted without any call: Authorization / Cookie style headers, password= / token= style values, bearer tokens, JWTs, and the text of every sensitive set_text / type_text of this attachment (4 characters or longer).
The entries from a starting point, oldest first, in batches. With follow the stream stays open for new entries until the caller cancels it or the device is detached; a follower that falls too far behind is ended with RESOURCE_EXHAUSTED and reads again after its last cursor. Requires the connection's current attachment; use HistoryService after detach/restart.
tap.v1 — what happened on this daemon: the calls each connection made, the crashes and ANRs
seen on its devices and those devices' logs. The daemon keeps them after detach and restart
under its retention policy (tap config logging-policy); a history recording keeps one
connection's range past that policy until it is deleted. DeviceLogService reads, follows,
marks and redacts the log of a device that is attached now; this service reads what was kept.
Access: the daemon token grants all history in this daemon. A connection id says whose
activity to read; it is not the caller's identity and not a security boundary.
Missing evidence is always reported, in one of two forms:
- a gap entry, in time order, where capture stopped and later resumed (the device
disconnected, logcat restarted, a recording stopped while calls were running);
- a HistoryIssue, for loss that has no position in time (entries removed by retention, a
source that could not be read or stored, lines whose app was not known).
When the daemon received the entry. For a call that is when it ended; the call's own started_at_ms is when it began. Entries are ordered by this, then source, then sequence.
Lines of these apps, by the package names saved with each line while its device was attached. Lines saved without them are returned and reported as an issue, never matched against a later attachment's packages.
From the newest marker with this name in the selection, the marker included. Each selected device (serial) contributes its newest such marker, across its attachments; with several devices the read starts at the earliest of them (history mark writes one per device). Select a connection to leave out markers of other connections. NOT_FOUND when no selected device has one. Entries received in the marker's millisecond are ordered by source id, then sequence, so some of them may fall before it.
Through the newest marker with this name in the selection, the marker included: with several devices, through the latest of each device's newest such marker. NOT_FOUND when none has one.
Only what happened in this step (LoggedEvent.step): its calls; the deaths and gaps received between the start of its first call and the end of its last; and device-log entries from its first action to its last. A step name used again after another step makes a second such run; the steps between them are left out. The read's bounds still apply.
page.next_cursor of the previous page. Send it alone, or with the first page's request unchanged; only limit may differ. Anything else is INVALID_ARGUMENT.
1 to 80 ASCII letters, digits, dots, dashes and underscores. FAILED_PRECONDITION when this connection already has a recording with the name, or storage is too full to keep it.
Retention removed entries the read asked for: the range starts before what is kept, entries in it passed the retention age, or entries went while paging. A read without a start begins at the oldest kept entry and so reports none for that.
HISTORY_ISSUE_KIND_UNAVAILABLE
2
A requested or recorded source is not kept or could not be read.
HISTORY_ISSUE_KIND_INCOMPLETE
3
The daemon could not keep all of the source's evidence (storage limit or failure), or withholds its kept entries because a redaction could not be applied to them: the message says what.
HISTORY_ISSUE_KIND_PACKAGE_UNKNOWN
4
Some lines were saved without their app; a package filter returned them unfiltered.
One page of entries, oldest first unless newest_first. The daemon applies every bound and filter, so a short window reads only the stored files that overlap it.
Keeps a connection's activity from now on, including devices it attaches later, until the recording is stopped and deleted. It stops by itself when the connection closes. A device whose capture already failed joins too, with an INCOMPLETE issue. NOT_FOUND when the connection is not open.
Deletes a stopped recording, so retention may remove its entries. Files saved separately (screenshots, captures) are not touched. FAILED_PRECONDITION while it is recording.
Host receipt of the full packet on the clock clock_id names — the clock of LoggedEvent.started_monotonic_ns. Not device capture or input execution time.
The daemon-wide activity log after after_seq: the retained backlog, then live activity as it happens, until the client cancels or the daemon stops. The first response also carries the live connections, so names survive eviction of their connection_opened.
One device's screen as H.264, from a scrcpy server the daemon runs while anyone watches that serial; readers of one serial share it. Needs tap start --scrcpy-server. No input, no screen wake, no attachment.
The log of an attached device (device_log.proto) after after_cursor: what the daemon still has, then new entries as they arrive, until the device is detached (the stream then ends normally) or the client cancels. Redacted like ReadLog, unfiltered. A reader that falls too far behind is ended with RESOURCE_EXHAUSTED and reads again after its last cursor. NOT_FOUND for an attachment that is gone, FAILED_PRECONDITION when it captures no log.