Skip to content

gRPC server API (tap.v1)

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.

app.proto

AppTarget

The package an App call acts on, on a device the calling connection has attached.

Field Type Label Description
client_connection_id string
attached_device_id string
package_name string

AwaitIdleRequest

Field Type Label Description
app AppTarget
timeout_ms int64 optional
stable_for_ms int64 optional absent = 200

AwaitIdleResponse

ClearDataRequest

Field Type Label Description
app AppTarget
timeout_ms int64 optional

ClearDataResponse

ColdLaunchRequest

Field Type Label Description
app AppTarget
activity string optional absent = launcher activity
timeout_ms int64 optional
extras IntentExtra repeated as LaunchRequest

ColdLaunchResponse

Field Type Label Description
process ProcessIdentity

ForceStopRequest

Field Type Label Description
app AppTarget
timeout_ms int64 optional

ForceStopResponse

ForegroundRequest

Field Type Label Description
app AppTarget
timeout_ms int64 optional

ForegroundResponse

GetLocalesRequest

Field Type Label Description
app AppTarget

GetLocalesResponse

Field Type Label Description
locales string repeated

GrantPermissionRequest

Field Type Label Description
app AppTarget
permission string

GrantPermissionResponse

InstallHeader

Field Type Label Description
app AppTarget package_name: the package the APK must install as
timeout_ms int64 optional
size_bytes int64 exact APK size; the upload is rejected on mismatch

InstallRequest

Field Type Label Description
header InstallHeader first message only
chunk bytes every later message

InstallResponse

IntentExtra

One am start extra. key: 1..256 chars, no whitespace or control characters.

Field Type Label Description
key string
string_value string --es (≤ 4096 chars)
bool_value bool --ez
int_value int32 --ei
long_value int64 --el
float_value float --ef (finite)

IsInstalledRequest

Field Type Label Description
app AppTarget

IsInstalledResponse

Field Type Label Description
installed bool

IsPermissionGrantedRequest

Field Type Label Description
app AppTarget
permission string

IsPermissionGrantedResponse

Field Type Label Description
granted bool

IsRunningRequest

Field Type Label Description
app AppTarget

IsRunningResponse

Field Type Label Description
running bool

LaunchRequest

Field Type Label Description
app AppTarget
activity string optional absent = launcher activity
timeout_ms int64 optional
extras IntentExtra repeated ≤ 64, distinct keys

LaunchResponse

OpenLinkRequest

Field Type Label Description
app AppTarget
uri string an absolute URI (scheme required); ≤ 2048 chars, no whitespace or control characters
any_app bool 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.
timeout_ms int64 optional

OpenLinkResponse

Field Type Label Description
activity string optional The activity Android reports it started or delivered the link to (package/class); absent when am start names none.

ProcessIdentity

PID plus a start token that changes on every process start.

Field Type Label Description
pid int32
start_token string

ProcessRequest

Field Type Label Description
app AppTarget
timeout_ms int64 optional

ProcessResponse

Field Type Label Description
process ProcessIdentity

RevokePermissionRequest

Field Type Label Description
app AppTarget
permission string

RevokePermissionResponse

SetLocalesRequest

Field Type Label Description
app AppTarget
locales string repeated At most 16 well-formed, distinct BCP-47 tags (fr-FR, pt-BR, zh-Hant-TW).

SetLocalesResponse

UninstallRequest

Field Type Label Description
app AppTarget

UninstallResponse

AppService

Method Name Request Type Response Type Description
Install InstallRequest stream InstallResponse adb install -r -t of the uploaded APK, verified. The client streams an InstallHeader first, then the APK bytes in chunks.
Uninstall UninstallRequest UninstallResponse pm uninstall, verified.
IsInstalled IsInstalledRequest IsInstalledResponse
ForceStop ForceStopRequest ForceStopResponse am force-stop plus proof that no process and no activity of the package remain.
ClearData ClearDataRequest ClearDataResponse pm clear; data, cache and runtime permissions gone, app left stopped (no process, no activity).
GrantPermission GrantPermissionRequest GrantPermissionResponse pm grant a runtime permission.
RevokePermission RevokePermissionRequest RevokePermissionResponse pm revoke a runtime permission, verified like a grant. Android kills the app's process.
IsPermissionGranted IsPermissionGrantedRequest IsPermissionGrantedResponse Whether dumpsys package lists the permission as granted to the package (a read; not logged).
SetLocales SetLocalesRequest SetLocalesResponse 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.
GetLocales GetLocalesRequest GetLocalesResponse The app's own languages now (cmd locale get-app-locales); empty = it follows the system.
Launch LaunchRequest LaunchResponse Start the activity (or the launcher); verify am start -W succeeded, not UI readiness.
ColdLaunch ColdLaunchRequest ColdLaunchResponse Verified force-stop, launch, then observe the new process identity; visibility is a separate wait.
Foreground ForegroundRequest ForegroundResponse 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.
OpenLink OpenLinkRequest OpenLinkResponse am start -W -a android.intent.action.VIEW -d <uri>, limited to the package unless any_app.
Process ProcessRequest ProcessResponse The single current process identity.
IsRunning IsRunningRequest IsRunningResponse Whether any process of the package is alive.
AwaitIdle AwaitIdleRequest AwaitIdleResponse Wait until the app's sync-sdk busy count is zero and stable for stable_for_ms.

app_data.proto

Private data of debuggable apps, through host-owned run-as; no root or arbitrary shell.

AppDataEntry

Field Type Label Description
name string basename, not an absolute path
size_bytes int64 regular files only; 0 for directories and symlinks
is_directory bool
is_symlink bool may be listed, never followed by data operations

AppDataHeader

Field Type Label Description
app AppTarget
path string
size_bytes int64
overwrite bool upload only; false refuses an existing destination

AppDataPart

Shared transfer body, wrapped by each RPC's distinct request/response envelope.

Field Type Label Description
header AppDataHeader once per file; chunks must exactly match size_bytes
chunk bytes at most 1 MiB

DeleteFileRequest

Field Type Label Description
app AppTarget
path string

DeleteFileResponse

ExportDatabaseRequest

Field Type Label Description
app AppTarget
name string basename in databases/, not a path or sidecar name

ExportDatabaseResponse

Field Type Label Description
part AppDataPart

GetCapabilitiesRequest

Field Type Label Description
app AppTarget

GetCapabilitiesResponse

Field Type Label Description
available bool
reason string optional Actionable reason without file contents; absent when available.

ImportDatabaseRequest

Field Type Label Description
part AppDataPart

ImportDatabaseResponse

ListFilesRequest

Field Type Label Description
app AppTarget
path string 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.

ListFilesResponse

Field Type Label Description
entries AppDataEntry repeated immediate children only, at most 1024

ReadFileRequest

Field Type Label Description
app AppTarget
path string

ReadFileResponse

Field Type Label Description
part AppDataPart

WriteFileRequest

Field Type Label Description
part AppDataPart

WriteFileResponse

AppDataService

Method Name Request Type Response Type Description
GetCapabilities GetCapabilitiesRequest GetCapabilitiesResponse Actual run-as access for the current Android user; safe while the app runs.
ListFiles ListFilesRequest ListFilesResponse All data operations below need a stopped app. Never stop/relaunch implicitly.
ReadFile ReadFileRequest ReadFileResponse stream
WriteFile WriteFileRequest stream WriteFileResponse One header first, then chunks. Create missing parents; at most 64 MiB.
DeleteFile DeleteFileRequest DeleteFileResponse One regular file only; no root/directory/recursive deletion.
ExportDatabase ExportDatabaseRequest ExportDatabaseResponse stream Base database first, then existing WAL/rollback journal. Never includes rebuildable SHM.
ImportDatabase ImportDatabaseRequest stream ImportDatabaseResponse 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.

capabilities.proto

tap.v1 — read-only operation support on one attached device, not wire negotiation.

DeviceCapability

Field Type Label Description
id CapabilityId
status CapabilityStatus
reasons CapabilityReason repeated
required_api int32 optional
requirements CapabilityRequirement repeated
detail string explanatory only; clients branch on typed fields

GetDeviceCapabilitiesRequest

Field Type Label Description
client_connection_id string
attached_device_id string

GetDeviceCapabilitiesResponse

Field Type Label Description
capabilities DeviceCapability repeated Sorted by ID, one entry per known ID (including unsupported); unknown future IDs are legal.

CapabilityId

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.

Name Number Description
CAPABILITY_UNSPECIFIED 0
CAPABILITY_DEVICE_INFO 1
CAPABILITY_PRESS_KEY 2
CAPABILITY_DUMP_HIERARCHY 3
CAPABILITY_EXISTS 4
CAPABILITY_COUNT 5
CAPABILITY_SNAPSHOT 6
CAPABILITY_WAIT_VISIBLE 7
CAPABILITY_WAIT_GONE 8
CAPABILITY_WAIT_APP_VISIBLE 9
CAPABILITY_WAIT_SCREEN_STABLE 10
CAPABILITY_TAP 11
CAPABILITY_LONG_TAP 12
CAPABILITY_SET_TEXT 13
CAPABILITY_TYPE_TEXT 14
CAPABILITY_CLEAR_TEXT 15
CAPABILITY_SWIPE 16
CAPABILITY_SCROLL 17
CAPABILITY_OPEN_SYSTEM_PANEL 18
CAPABILITY_SET_ORIENTATION 19
CAPABILITY_SET_DISPLAY_ROTATION 20
CAPABILITY_UNFREEZE_ROTATION 21
CAPABILITY_DISMISS_KEYGUARD 22
CAPABILITY_DOUBLE_TAP 23
CAPABILITY_DRAG 24
CAPABILITY_PINCH 25
CAPABILITY_FLING 26
CAPABILITY_WAIT_PERMISSION_PROMPT 27
CAPABILITY_CHOOSE_PERMISSION 28
CAPABILITY_HIDE_KEYBOARD 29
CAPABILITY_KEYBOARD_IME_ACTION 30
CAPABILITY_CLIPBOARD_WRITE 31
CAPABILITY_CLIPBOARD_READ 32
CAPABILITY_AWAIT_TOAST 33
CAPABILITY_ACCESSIBILITY_ACTION 34
CAPABILITY_SET_PROGRESS 35
CAPABILITY_SET_LOCATION 36
CAPABILITY_AWAIT_NOTIFICATION 37
CAPABILITY_LIST_NOTIFICATIONS 38
CAPABILITY_OPEN_NOTIFICATION 39
CAPABILITY_DISMISS_NOTIFICATION 40
CAPABILITY_MULTI_TAP 41
CAPABILITY_TIMED_PRESS 42
CAPABILITY_WAIT_STATE 43
CAPABILITY_ACCESSIBILITY_PAGE_UP 44
CAPABILITY_ACCESSIBILITY_PAGE_DOWN 45
CAPABILITY_ACCESSIBILITY_PAGE_LEFT 46
CAPABILITY_ACCESSIBILITY_PAGE_RIGHT 47
CAPABILITY_ACCESSIBILITY_PRESS_AND_HOLD 48
CAPABILITY_SCREENSHOT 49
CAPABILITY_DRIVER_LOG 50
CAPABILITY_DEVICE_LOGS 51
CAPABILITY_SCREEN_SNAPSHOT 52
CAPABILITY_RESOLVE_REF 53
CAPABILITY_DEVICE_SET_ANIMATIONS 54
CAPABILITY_DEVICE_SET_DARK_MODE 55
CAPABILITY_DEVICE_SET_FONT_SCALE 56
CAPABILITY_DEVICE_SET_DENSITY 57
CAPABILITY_DEVICE_SET_NETWORK 58
CAPABILITY_NETWORK_DISABLE_WIFI 59
CAPABILITY_NETWORK_ENABLE_AIRPLANE_MODE 60
CAPABILITY_DEVICE_SET_SYSTEM_LOCALES 61
CAPABILITY_DEVICE_SET_STAY_AWAKE 62
CAPABILITY_DEVICE_SET_ACCESSIBILITY_DISPLAY 63
CAPABILITY_DEVICE_SET_BOLD_TEXT 64
CAPABILITY_GET_FOREGROUND_ACTIVITY 65
CAPABILITY_PUSH_FILE 66
CAPABILITY_PULL_FILE 67
CAPABILITY_ADD_MEDIA 68
CAPABILITY_RECORD_VIDEO 69
CAPABILITY_RECORD_AUDIO_OUTPUT 70
CAPABILITY_RECORD_AUDIO_PLAYBACK 71
CAPABILITY_RECORD_AUDIO_MIC 72
CAPABILITY_STOP_RECORDING 73
CAPABILITY_APP_INSTALL 74
CAPABILITY_APP_UNINSTALL 75
CAPABILITY_APP_IS_INSTALLED 76
CAPABILITY_APP_FORCE_STOP 77
CAPABILITY_APP_CLEAR_DATA 78
CAPABILITY_APP_GRANT_PERMISSION 79
CAPABILITY_APP_REVOKE_PERMISSION 80
CAPABILITY_APP_IS_PERMISSION_GRANTED 81
CAPABILITY_APP_SET_LOCALES 82
CAPABILITY_APP_GET_LOCALES 83
CAPABILITY_APP_LAUNCH 84
CAPABILITY_APP_COLD_LAUNCH 85
CAPABILITY_APP_FOREGROUND 86
CAPABILITY_APP_OPEN_LINK 87
CAPABILITY_APP_PROCESS 88
CAPABILITY_APP_IS_RUNNING 89
CAPABILITY_TAP_OUTSIDE_PANEL 90
CAPABILITY_SNAPSHOTS 91
CAPABILITY_READ_TOAST_HISTORY 92
CAPABILITY_DEVICE_EVENTS 93
CAPABILITY_DEVICE_SET_SHOW_IME_WITH_HARD_KEYBOARD 94

CapabilityReason

Name Number Description
CAPABILITY_REASON_UNSPECIFIED 0
CAPABILITY_REASON_REQUIRES_API 1
CAPABILITY_REASON_MISSING_HOST_TOOL 2
CAPABILITY_REASON_NETWORK_ADB 3
CAPABILITY_REASON_NOT_NEGOTIATED 4
CAPABILITY_REASON_FACT_UNAVAILABLE 5
CAPABILITY_REASON_PREREQUISITE 6

CapabilityRequirement

Specific remaining requirements; discovery never exercises the operation to satisfy them.

Name Number Description
CAPABILITY_REQUIREMENT_UNSPECIFIED 0
CAPABILITY_REQUIREMENT_TARGET_OFFERS_ACTION 1
CAPABILITY_REQUIREMENT_NONSECURE_KEYGUARD 2
CAPABILITY_REQUIREMENT_PERMISSION_CHOICE_OFFERED 3
CAPABILITY_REQUIREMENT_RECORDING_RUNTIME 4 compatible scrcpy, encoders, capture access
CAPABILITY_REQUIREMENT_CAPTURE_NOT_EXCLUDED 5 playback apps may exclude their audio
CAPABILITY_REQUIREMENT_SAFE_NETWORK_VALUES 6
CAPABILITY_REQUIREMENT_RECORDING_ACTIVE 7

CapabilityStatus

Eligibility, not a promise of success: matching, occlusion, Android acceptance and transport checks remain authoritative. No automatic fallback, skip, preflight or mutation is implied.

Name Number Description
CAPABILITY_STATUS_UNSPECIFIED 0
CAPABILITY_STATUS_SUPPORTED 1
CAPABILITY_STATUS_CONDITIONAL 2
CAPABILITY_STATUS_UNSUPPORTED 3
CAPABILITY_STATUS_UNKNOWN 4

selector.proto

AllOf

Conjunction: every operand must hold. At least two operands.

Field Type Label Description
nodes Node repeated

AnyOf

Disjunction: at least one operand must hold. At least two operands. Evaluated by the driver's traversal plan rather than a native BySelector.

Field Type Label Description
nodes Node repeated

At

Field Type Label Description
index int32

ExactlyOne

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).

First

Flag

A boolean property that must equal value.

Field Type Label Description
property NodeFlag
value bool

Match

A string property compared against value under mode.

Field Type Label Description
property TextProperty
value string
mode MatchMode

Node

One node predicate of the selector expression tree. Limits over the whole tree: depth ≤ 32, ≤ 256 nodes, strings ≤ 1024 chars.

Field Type Label Description
match Match
flag Flag
resource ResourceId
related Related
all_of AllOf
any_of AnyOf

The relation of the node must satisfy node.

Field Type Label Description
relation Relation
node Node

ResourceId

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.

Field Type Label Description
name string
package_name string optional

Selector

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.

Field Type Label Description
node Node
exactly_one ExactlyOne
first First
at At

MatchMode

How a Match compares; REGEX is RE2 syntax, full match.

Name Number Description
MATCH_UNSPECIFIED 0 = MATCH_EXACT
MATCH_EXACT 1
MATCH_CONTAINS 2
MATCH_STARTS_WITH 3
MATCH_ENDS_WITH 4
MATCH_REGEX 5

NodeFlag

The boolean node properties a Flag can constrain.

Name Number Description
FLAG_UNSPECIFIED 0 rejected
FLAG_ENABLED 1
FLAG_CHECKED 2
FLAG_CHECKABLE 3
FLAG_CLICKABLE 4
FLAG_FOCUSED 5
FLAG_FOCUSABLE 6
FLAG_LONG_CLICKABLE 7
FLAG_SCROLLABLE 8
FLAG_SELECTED 9
FLAG_EDITABLE 10 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).

Relation

Which relative a Related constrains.

Name Number Description
RELATION_UNSPECIFIED 0 rejected
RELATION_PARENT 1 the direct parent matches
RELATION_ANCESTOR 2 some ancestor matches
RELATION_CHILD 3 at least one direct child matches
RELATION_DESCENDANT 4 at least one descendant matches

TextProperty

The string-valued node properties a Match can constrain.

Name Number Description
PROPERTY_UNSPECIFIED 0 rejected
PROPERTY_TEXT 1
PROPERTY_CONTENT_DESCRIPTION 2
PROPERTY_HINT 3
PROPERTY_CLASS_NAME 4
PROPERTY_PACKAGE_NAME 5

command.proto

AppDeath

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.

Field Type Label Description
sequence int64 Per attachment, from 1, in the order the deaths were logged.
kind AppDeath.Kind
package_name string
process_name string The process, package_name or package_name:suffix.
pid int32
at_epoch_ms int64 The device clock when Android logged it.
exception_class string Crash: the exception class (java.lang.IllegalStateException, or Native crash). ANR: empty.
message string Crash: the exception message. ANR: Android's reason (Input dispatching timed out …).
stack_trace string 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.
watched bool 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.
handled bool 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.

AwaitNotification

Waits until a matching notification is active (one already posted counts) and returns the newest; WAIT_TIMEOUT (NO_NOTIFICATION) otherwise. No input.

Field Type Label Description
match NotificationMatch

AwaitToast

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.

Field Type Label Description
text string optional
mode MatchMode
package_name string optional

Bounds

Screen-pixel rectangle.

Field Type Label Description
left int32
top int32
right int32
bottom int32

ChoosePermission

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.

Field Type Label Description
choice PermissionChoice not UNSPECIFIED
accuracy LocationAccuracy

ClearText

Field Type Label Description
selector Selector

Command

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.

Field Type Label Description
timeout_ms int64 optional absent = the attached device's default action timeout
device_info DeviceInfoQuery
press_key PressKey
dump_hierarchy DumpHierarchy
exists Exists
count Count
snapshot Snapshot
wait_visible WaitVisible
wait_gone WaitGone
wait_app_visible WaitAppVisible
wait_screen_stable WaitScreenStable
tap Tap
long_tap LongTap
set_text SetText
type_text TypeText
clear_text ClearText
swipe Swipe
scroll Scroll
open_system_panel OpenSystemPanel
set_orientation SetOrientation
set_display_rotation SetDisplayRotation
unfreeze_rotation UnfreezeRotation
dismiss_keyguard DismissKeyguard
double_tap DoubleTap
drag Drag
pinch Pinch
fling Fling
wait_permission_prompt WaitPermissionPrompt
choose_permission ChoosePermission
hide_keyboard HideKeyboard
perform_ime_action PerformImeAction
set_clipboard SetClipboard
get_clipboard GetClipboard
await_toast AwaitToast
perform_accessibility_action PerformAccessibilityAction
set_progress SetProgress
set_location SetLocation
await_notification AwaitNotification
list_notifications ListNotifications
open_notification OpenNotification
dismiss_notification DismissNotification
multi_tap MultiTap
hold TimedPress
wait_state WaitState
tap_outside_panel TapOutsidePanel
snapshots Snapshots
read_toast_history ReadToastHistory

CommandResult

One protocol response: exactly one outcome, named like the protocol result kind.

Field Type Label Description
scroll_observation ScrollObservation Optional metadata: older drivers omit it. Scroll still reports done.
duration_ms int64
request_id int64 Identity of the protocol request the server issued, for diagnostics.
session_generation int64
done Done
bool bool exists
count int32 count, capped at 1000
text string dump_hierarchy, get_clipboard
snapshot ElementSnapshot
device_info DeviceInfo
error Error
permission_prompt PermissionPrompt
toast Toast
notification DeviceNotification await_notification
notifications NotificationList list_notifications
outside_touch OutsideTouch tap_outside_panel
snapshots ElementSnapshotList
toast_history ToastHistory

Count

Field Type Label Description
selector Selector

DeviceInfo

Static facts about the device plus the package currently owning the focused window.

Field Type Label Description
api_level int32
manufacturer string
model string
product string
display_width int32
display_height int32
display_rotation int32
current_package string optional
screen_on bool PowerManager.isInteractive
keyguard_locked bool KeyguardManager.isKeyguardLocked
keyguard_secure bool a PIN, pattern or password is set
keyboard_shown bool an input-method window is on screen
auto_rotate bool Settings.System.ACCELEROMETER_ROTATION: the sensor picks the rotation
animations_enabled bool any of the three animation scales is not 0
dark_mode bool 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. |

DeviceInfoQuery

DeviceNotification

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).

Field Type Label Description
package_name string
title string optional
text string optional
actions string repeated
clearable bool
posted_at_ms int64

DismissKeyguard

Dismisses a keyguard that has no PIN, pattern or password; a secure one is refused, never unlocked.

DismissNotification

Dismisses the one matching notification as a swipe does. NOT_FOUND / AMBIGUOUS, or ACTION_REJECTED (NOT_CLEARABLE) for an ongoing one, before anything changes.

Field Type Label Description
match NotificationMatch

Done

The command ran to completion and has nothing else to report.

DoubleTap

Two taps on the element's visible centre within Android's double-tap window, as one gesture.

Field Type Label Description
selector Selector

Drag

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.

Field Type Label Description
selector Selector
target Selector

DumpHierarchy

ElementSnapshot

State of one matched node at the instant of snapshot.

Field Type Label Description
class_name string optional
package_name string optional
resource_name string optional
text string optional
content_description string optional
hint string optional
bounds Bounds
checkable bool
checked bool
clickable bool
enabled bool
focusable bool
focused bool
long_clickable bool
scrollable bool
selected bool
child_count int32
showing_hint bool 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.
actions StandardAction repeated The standard actions (of StandardAction) and the custom actions (by label) the node offers.
custom_actions string repeated
range Range optional A range node's (SeekBar, Slider, RatingBar, ProgressBar) RangeInfo.
editable bool Editable text (AccessibilityNodeInfo.isEditable), whatever its class.

ElementSnapshotList

Immutable values in the match order of snapshots; no persistent node identities.

Field Type Label Description
elements ElementSnapshot repeated

Error

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.

Field Type Label Description
code ErrorCode
detail string optional stable sub-reason; see the errors guide
message string optional human-readable context; never branch on it
match_count int32 optional WAIT_TIMEOUT of wait_visible / wait_gone: matches at the last poll (capped at 1000).
last_state ElementSnapshot optional WAIT_TIMEOUT / STATE_NOT_REACHED of wait_state: the waited-on node after the deadline.
condition_holds bool repeated 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.
narrowing SelectorNarrowing optional 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.
app_death AppDeath optional AUT_CRASHED / AUT_ANR: the death that replaced the code. Set by the host server only; the driver never sends it.

Exists

Field Type Label Description
selector Selector

Fling

A fast swipe across the element. direction is the content edge moved towards, as for scroll.

Field Type Label Description
selector Selector
direction Direction

GetClipboard

Reads the primary clip as plain text (text result; "" when the clipboard is empty).

HideKeyboard

Hides the on-screen keyboard: one Back key when an input-method window is showing, nothing otherwise.

ListNotifications

The active notifications, newest first. No input.

LongTap

Field Type Label Description
selector Selector

MultiTap

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.

Field Type Label Description
selector Selector
count int32
interval_ms int64 optional

NarrowingPart

One operand of a selector's top-level all_of.

Field Type Label Description
alone int32 nodes this operand matches by itself (capped at 1000)
without int32 nodes every other operand matches (capped at 1000)
near_misses string repeated 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.

NotificationList

Field Type Label Description
notifications DeviceNotification repeated

NotificationMatch

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.

Field Type Label Description
package_name string optional
title string optional
text string optional
mode MatchMode

OpenNotification

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.

Field Type Label Description
match NotificationMatch
action string optional

OpenSystemPanel

Opens panel (the accessibility global action); no target. Back or Home close it.

Field Type Label Description
panel SystemPanel

OutsideTouch

Where tap_outside_panel touched and which panel it chose, for logs and failures.

Field Type Label Description
x int32
y int32
panel string 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.

PerformAccessibilityAction

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.

Field Type Label Description
selector Selector
standard StandardAction not UNSPECIFIED
custom string

PerformImeAction

The keyboard's action key (Search, Go, Done, …) on the field: ACTION_IME_ENTER, API 30+.

Field Type Label Description
selector Selector

PermissionPrompt

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.

Field Type Label Description
package_name string
choices PermissionChoice repeated
accuracies LocationAccuracy repeated The location accuracies the dialog offers to pick (empty when it asks for none).

Pinch

Two fingers across the element's bounds, moving percent of its size (1..100; default 80).

Field Type Label Description
selector Selector
direction PinchDirection
percent int32 optional

PressKey

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).

Field Type Label Description
key_code int32
long_press bool true when set
duration_ms int64 1..30000
count int32 optional 1..100, default 1
interval_ms int64 optional release to next press, 40..1000, default 100

Range

Field Type Label Description
type RangeType
min float
max float
current float

ReadToastHistory

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.

Field Type Label Description
after_sequence int64 >= 0; exclusive, within stream_id
stream_id string empty for an initial read

Scroll

Field Type Label Description
selector Selector
direction Direction
distance_percent int32 optional 1..100; default 80

ScrollObservation

Source-attributed accessibility evidence during one scroll. Unknown is not an end.

Field Type Label Description
movement ScrollObservation.Movement
edge ScrollObservation.Edge

SelectorNarrowing

Why a selector resolved no node. Diagnostic only: read once after the command failed, from the screen as it was then, and never used to choose a node.

Field Type Label Description
selector_index int32 Which of the command's selectors this is: 0 for selector, 1 for drag's target.
matches int32 Nodes the selector's node matches, its pick ignored (capped at 1000). Above zero, the pick is what failed: at { index } needs index + 1 matches.
parts NarrowingPart repeated When matches is 0 and the node is an all_of: one entry per operand, in order. Otherwise empty.

SetClipboard

Replaces the primary clip with plain text (≤ 4096 chars).

Field Type Label Description
text string

SetDisplayRotation

Field Type Label Description
rotation DisplayRotation

SetLocation

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).

Field Type Label Description
latitude double
longitude double
accuracy_m float optional
altitude_m double optional

SetOrientation

Sets portable geometry or an exact natural-relative rotation and freezes sensor rotation.

Field Type Label Description
orientation Orientation

SetProgress

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.

Field Type Label Description
selector Selector
value float

SetText

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.

Field Type Label Description
selector Selector
text string ≤ 256 chars
sensitive bool

Snapshot

Field Type Label Description
selector Selector

Snapshots

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.

Field Type Label Description
selector Selector

Swipe

Field Type Label Description
selector Selector
direction Direction
distance_percent int32 optional 1..100; default 80

Tap

Field Type Label Description
selector Selector

TapOutsidePanel

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.

Field Type Label Description
selector Selector
allow_reach_below bool

TimedPress

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.

Field Type Label Description
selector Selector
duration_ms int64

Toast

A toast await_toast matched: its text and the package that posted it.

Field Type Label Description
text string
package_name string

ToastEvent

Immutable observation, not a current UI element. Text is capped at 1024 UTF-16 code units.

Field Type Label Description
sequence int64
at_epoch_ms int64 device wall clock, informational; order by sequence
toast Toast
text_truncated bool

ToastHistory

Last 128 observations for the lifetime of this driver listener; not disk-persistent.

Field Type Label Description
stream_id string
events ToastEvent repeated
next_sequence int64 high-water mark (last observed sequence, 0 when empty)
oldest_sequence int64 first retained sequence; next_sequence + 1 when empty
gap bool observations after the requested cursor were evicted, or stream reset
reset bool requested stream no longer exists, or cursor is ahead of this stream

TypeText

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.

Field Type Label Description
text string
sensitive bool

UnfreezeRotation

Releases the sensor lock without selecting a new rotation.

WaitAppVisible

Field Type Label Description
package_name string

WaitGone

Field Type Label Description
selector Selector

WaitPermissionPrompt

Waits for a runtime-permission dialog and reports the choices it offers. No input.

WaitScreenStable

Field Type Label Description
package_name string
stable_for_ms int64 optional quiet period, 1..30000; default 500
signal StabilitySignal UNSPECIFIED = ALL

WaitState

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.

Field Type Label Description
selector Selector
condition Node required; a predicate on the chosen node (it has no pick of its own)

WaitVisible

Field Type Label Description
selector Selector
exactly_one bool true = wait for exactly one match (a mutation's precondition); false = one or more.

AppDeath.Kind

Name Number Description
KIND_UNSPECIFIED 0
KIND_CRASH 1 a Java exception or a native crash ended the process
KIND_ANR 2 the app stopped answering input or a broadcast/service in time

Direction

Gesture direction: where the finger moves for swipe, the content edge scrolled towards for scroll (DOWN reveals content below).

Name Number Description
DIR_UNSPECIFIED 0
DIR_UP 1
DIR_DOWN 2
DIR_LEFT 3
DIR_RIGHT 4

DisplayRotation

Exact clockwise display rotation relative to the device's natural orientation.

Name Number Description
DISPLAY_ROTATION_UNSPECIFIED 0
DISPLAY_ROTATION_NATURAL 1
DISPLAY_ROTATION_LEFT 2
DISPLAY_ROTATION_UPSIDE_DOWN 3
DISPLAY_ROTATION_RIGHT 4

ErrorCode

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.

LocationAccuracy

The Precise / Approximate radio buttons of the location dialog (API 31+, when the app asks for fine location).

Name Number Description
LOCATION_ACCURACY_UNSPECIFIED 0
LOCATION_PRECISE 1
LOCATION_APPROXIMATE 2

Orientation

Portable geometry, independent of the device's natural orientation.

Name Number Description
ORIENTATION_UNSPECIFIED 0
ORIENTATION_PORTRAIT 1
ORIENTATION_LANDSCAPE 2

PermissionChoice

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)

PinchDirection

Opposite finger movements for pinch: OPEN spreads two fingers apart (zoom in), CLOSE brings them together (zoom out).

Name Number Description
PINCH_UNSPECIFIED 0
PINCH_OPEN 1
PINCH_CLOSE 2

RangeType

How a range node counts (AccessibilityNodeInfo.RangeInfo).

Name Number Description
RANGE_TYPE_UNSPECIFIED 0
RANGE_INT 1
RANGE_FLOAT 2
RANGE_PERCENT 3

ScrollObservation.Edge

Name Number Description
EDGE_UNSPECIFIED 0 unknown
EDGE_REACHED 1
EDGE_NOT_REACHED 2

ScrollObservation.Movement

Name Number Description
MOVEMENT_UNSPECIFIED 0 unknown
MOVEMENT_MOVED 1
MOVEMENT_UNCHANGED 2

StabilitySignal

What wait_screen_stable watches: the accessibility tree, the screen pixels, or both.

Name Number Description
STABILITY_UNSPECIFIED 0 = STABILITY_ALL
STABILITY_TREE 1
STABILITY_PIXELS 2
STABILITY_ALL 3

StandardAction

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.

Name Number Description
STANDARD_ACTION_UNSPECIFIED 0
A11Y_EXPAND 1
A11Y_COLLAPSE 2
A11Y_DISMISS 3
A11Y_SCROLL_FORWARD 4
A11Y_SCROLL_BACKWARD 5
A11Y_SCROLL_UP 6
A11Y_SCROLL_DOWN 7
A11Y_SCROLL_LEFT 8
A11Y_SCROLL_RIGHT 9
A11Y_PAGE_UP 10 API 29+
A11Y_PAGE_DOWN 11 API 29+
A11Y_PAGE_LEFT 12 API 29+
A11Y_PAGE_RIGHT 13 API 29+
A11Y_SHOW_ON_SCREEN 14
A11Y_CONTEXT_CLICK 15
A11Y_PRESS_AND_HOLD 16 API 30+
A11Y_SELECT 17
A11Y_CLEAR_SELECTION 18
A11Y_FOCUS 19 input focus
A11Y_CLEAR_FOCUS 20
A11Y_COPY 21
A11Y_CUT 22
A11Y_PASTE 23

SystemPanel

A panel System UI draws over every app, opened with open_system_panel.

Name Number Description
SYSTEM_PANEL_UNSPECIFIED 0
SYSTEM_PANEL_NOTIFICATIONS 1 the notification shade
SYSTEM_PANEL_QUICK_SETTINGS 2 the quick settings panel

failure.proto

Failure

Field Type Label Description
reason FailureReason
serial string The device the failure is about, when there is one.
waited_ms int64 DEVICE_BUSY: how long the lock was waited for. HOST_WAIT_TIMEOUT: how long the wait ran.
error_code ErrorCode DRIVER_COMMAND / DRIVER_TRANSPORT: the driver or transport error code and its detail.
detail string

FailureReason

Name Number Description
FAILURE_REASON_UNSPECIFIED 0
FAILURE_REASON_INTERNAL 1 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).

event_log.proto

AppCall

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.

Field Type Label Description
operation string
package_name string
activity string optional launch / cold_launch.
permission string optional grant_permission / revoke_permission.
timeout_ms int64 optional The explicit timeout the call carried.
uri string optional open_link.
any_app bool optional
extras IntentExtra repeated launch / cold_launch with extras.
locales string repeated set_locales.

DeviceCall

A DeviceService condition call. operation is the RPC in snake_case: set_animations, set_dark_mode, set_font_scale, set_density, set_network, set_system_locales, set_location, push_file, pull_file, add_media, set_stay_awake, set_show_ime_with_hard_keyboard, set_accessibility_display.

Field Type Label Description
operation string
enabled bool optional set_animations / set_dark_mode / set_stay_awake / set_show_ime_with_hard_keyboard.
font_scale float optional set_font_scale.
density_dpi int32 optional set_density; absent there = back to the physical density.
airplane_mode bool optional set_network: the switches the call set.
wifi bool optional
mobile_data bool optional
locales string repeated set_system_locales.
latitude double optional set_location (with accuracy_m / altitude_m below).
longitude double optional
device_path string optional push_file / pull_file / add_media: the device file and its size.
size_bytes int64 optional
high_contrast_text bool optional set_accessibility_display: the settings the call set (set_stay_awake and set_show_ime_with_hard_keyboard use enabled).
color_inversion bool optional
bold_text bool optional
accuracy_m float optional set_location: the accuracy and altitude the call gave.
altitude_m double optional

LoggedEvent

Field Type Label Description
seq int64 1, 2, 3, … per connection; never reused.
at_epoch_ms int64 When the call started.
duration_ms int64
serial string
command Command
app AppCall
device DeviceCall
error Error optional The command ran and the driver returned an error (CommandResult.error).
failure Failure optional The call failed as an RPC (the tap-failure-bin trailer), e.g. an app lifecycle failure.
started_monotonic_ns int64 optional 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.
finished_monotonic_ns int64 optional
clock_id string
step string optional The tap-step header the call carried (LogAction.step); absent when it carried none.
indeterminate bool The call was cancelled after admission; its effect is not known. Never replay it.
attached_device_id string Original attachment generation identity, never a persistent element handle.

client_connection.proto

AttachedDeviceEntry

Field Type Label Description
attached_device_id string
serial string
generation int64

Closing

The daemon is disconnecting this client (Disconnect, reaping or shutdown); the stream ends next.

Field Type Label Description
reason string

ConnectRequest

Field Type Label Description
name string
hold Hold optional 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).

ConnectResponse

Field Type Label Description
client_connection_id string

ConnectionEntry

Field Type Label Description
client_connection_id string
name string
hold Hold optional Set for a held connection.
idle_ms int64 Since the last call that named the connection.
attached_devices AttachedDeviceEntry repeated
created_at_epoch_ms int64
last_activity_at_epoch_ms int64
in_flight int32 Calls naming this connection currently executing; inspection does not renew it.
observing bool

Defaults

Field Type Label Description
action_timeout_ms int64 Attach without default_timeout_ms (the timeout of every command without its own), and force-stop, clear-data and process queries without timeout_ms.
wait_timeout_ms int64 AwaitIdle without timeout_ms.
lifecycle_timeout_ms int64 Install, launch and cold launch without timeout_ms.
idle_stable_ms int64 AwaitIdle without stable_for_ms.
acquire_timeout_ms int64 How long clients wait for a device another session holds (Attach lease_timeout_ms).

DisconnectRequest

Field Type Label Description
client_connection_id string
reason string Optional administrative reason, at most 512 characters, no control characters. Empty retains "client request". Recorded in lifecycle logs and sent to Observe.

DisconnectResponse

Field Type Label Description
attached_devices_detached int32
cleanup_issues DisconnectResponse.CleanupIssuesEntry repeated 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.

DisconnectResponse.CleanupIssuesEntry

Field Type Label Description
key string
value string

EventsRequest

Field Type Label Description
client_connection_id string
after_seq int64 Only events with a larger seq; 0 for all that are kept.

EventsResponse

Field Type Label Description
events LoggedEvent repeated
dropped int64 Events evicted from the log since the connection began (the log keeps the last 2000).

Heartbeat

Idle traffic so proxies keep the stream open; not a death detector.

Hold

Field Type Label Description
idle_timeout_ms int64 1000..86400000.

InfoRequest

InfoResponse

Field Type Label Description
daemon_version string
host_build_id string
protocol_version string
adb_executable string
state_dir string
driver_available bool Whether attach installs a driver this daemon carries (bundled, or tap serve --driver-apk).
pid int64
defaults Defaults The defaults the daemon applies to an omitted timeout; clients use the same numbers.
api_compatibility uint32 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.
startup_options InfoResponse.StartupOptionsEntry repeated Allowlisted effective startup options (no credentials), for inspection and explicit restart. Empty on embedded daemons not launched by the CLI or on older servers.
startup_option_sources InfoResponse.StartupOptionSourcesEntry repeated Startup option -> source (command line, environment variable, or default).
administrative_disconnect_supported bool Disconnect accepts an audit reason and returns per-device cleanup issues. Administrative tools must require this before claiming a close was clean.

InfoResponse.StartupOptionSourcesEntry

Field Type Label Description
key string
value string

InfoResponse.StartupOptionsEntry

Field Type Label Description
key string
value string

ListConnectionsRequest

ListConnectionsResponse

Field Type Label Description
connections ConnectionEntry repeated

ObserveRequest

Field Type Label Description
client_connection_id string

ObserveResponse

Field Type Label Description
at_epoch_ms int64
observing Observing
heartbeat Heartbeat
closing Closing

Observing

The stream is registered; everything the connection attaches from now on is owned by it.

Field Type Label Description
client_connection_id string

ClientConnectionService

Method Name Request Type Response Type Description
Connect ConnectRequest ConnectResponse
Observe ObserveRequest ObserveResponse stream 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.
Disconnect DisconnectRequest DisconnectResponse
Info InfoRequest InfoResponse
ListConnections ListConnectionsRequest ListConnectionsResponse Every live connection with its attached devices; how a later process finds a held connection by name.
Events EventsRequest EventsResponse 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.

device_event.proto

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.

ContentChanged

Content inside a window changed (TYPE_WINDOW_CONTENT_CHANGED); frequent during animations.

Field Type Label Description
class_name string
window_id int32
changes ContentChange repeated Empty when Android did not say what changed (CONTENT_CHANGE_TYPE_UNDEFINED).

DeviceEvent

One event, copied from the AccessibilityEvent when it fired.

Field Type Label Description
sequence int64 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.
uptime_ms int64 Android uptime (SystemClock.uptimeMillis) when the event fired, not the wall clock.
package_name string The package that raised it; empty when Android names none.
toast_shown ToastShown
window_changed WindowChanged
content_changed ContentChanged
view_clicked ViewClicked
view_scrolled ViewScrolled
text_changed TextChanged

DeviceEventBatch

Events in the order they fired. Also the payload of the driver's DEVICE_EVENTS frame.

Field Type Label Description
events DeviceEvent repeated
dropped int64 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.

TextChanged

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.

Field Type Label Description
class_name string
text string The text after and before the change.
before_text string
from_index int32 optional Where the change starts, and how many characters were added and removed there.
added_count int32 optional
removed_count int32 optional
password bool The field is a password field: Android masks text and before_text.
window_id int32

ToastShown

A toast was shown (TYPE_NOTIFICATION_STATE_CHANGED without a Notification).

Field Type Label Description
text string The message, its text items joined as await_toast joins them.

ViewClicked

A view was clicked (TYPE_VIEW_CLICKED), by Tap or anyone else.

Field Type Label Description
class_name string
label string The view's text items joined; empty when it has none.
window_id int32

ViewScrolled

A view scrolled (TYPE_VIEW_SCROLLED). Absent values are ones the view did not report.

Field Type Label Description
class_name string
window_id int32
scroll_x int32 optional The scroll position and its maximum, in pixels (a list such as RecyclerView reports items instead).
scroll_y int32 optional
max_scroll_x int32 optional
max_scroll_y int32 optional
delta_x int32 optional How far this scroll moved, in pixels (API 28+).
delta_y int32 optional
from_index int32 optional For a list: the first and last visible item and how many there are.
to_index int32 optional
item_count int32 optional

WatchDeviceEventsRequest

Field Type Label Description
client_connection_id string
attached_device_id string
types DeviceEventType repeated The types to deliver: at least one, each a known value.
package_name string optional Only events this package raised (exact match); absent delivers every package's.

WatchDeviceEventsResponse

Field Type Label Description
ready bool The first response, always true: the subscription is installed, so every command sent after it is received has its events delivered.
batch DeviceEventBatch Matching events, in order.

WindowChanged

A window appeared, went away or changed (TYPE_WINDOW_STATE_CHANGED, TYPE_WINDOWS_CHANGED).

Field Type Label Description
class_name string The activity, dialog or view class; empty when Android names none.
title string The window's title or the pane's text; empty when there is none.
window_id int32 -1 when Android names none.
changes WindowChange repeated At least one: STATE for a state change, the flags Android set for TYPE_WINDOWS_CHANGED (none below API 28, where such an event is not forwarded).

ContentChange

What changed inside a window (AccessibilityEvent.getContentChangeTypes).

Name Number Description
CONTENT_CHANGE_UNSPECIFIED 0
CONTENT_CHANGE_SUBTREE 1
CONTENT_CHANGE_TEXT 2
CONTENT_CHANGE_CONTENT_DESCRIPTION 3
CONTENT_CHANGE_STATE_DESCRIPTION 4
CONTENT_CHANGE_PANE_TITLE 5
CONTENT_CHANGE_PANE_APPEARED 6
CONTENT_CHANGE_PANE_DISAPPEARED 7
CONTENT_CHANGE_DRAG_STARTED 8
CONTENT_CHANGE_DRAG_DROPPED 9
CONTENT_CHANGE_DRAG_CANCELLED 10
CONTENT_CHANGE_CONTENT_INVALID 11
CONTENT_CHANGE_ERROR 12
CONTENT_CHANGE_ENABLED 13

DeviceEventType

The kinds of event a subscription can ask for; each is one DeviceEvent kind case.

Name Number Description
DEVICE_EVENT_TYPE_UNSPECIFIED 0
DEVICE_EVENT_TOAST 1 toast_shown
DEVICE_EVENT_WINDOW_CHANGED 2 window_changed
DEVICE_EVENT_CONTENT_CHANGED 3 content_changed
DEVICE_EVENT_VIEW_CLICKED 4 view_clicked
DEVICE_EVENT_VIEW_SCROLLED 5 view_scrolled
DEVICE_EVENT_TEXT_CHANGED 6 text_changed

WindowChange

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+).

Name Number Description
WINDOW_CHANGE_UNSPECIFIED 0
WINDOW_CHANGE_STATE 1
WINDOW_CHANGE_ADDED 2
WINDOW_CHANGE_REMOVED 3
WINDOW_CHANGE_TITLE 4
WINDOW_CHANGE_BOUNDS 5
WINDOW_CHANGE_LAYER 6
WINDOW_CHANGE_ACTIVE 7
WINDOW_CHANGE_FOCUSED 8
WINDOW_CHANGE_ACCESSIBILITY_FOCUSED 9
WINDOW_CHANGE_PARENT 10
WINDOW_CHANGE_CHILDREN 11
WINDOW_CHANGE_PIP 12

device.proto

AcknowledgeAppDeathsRequest

Field Type Label Description
client_connection_id string
attached_device_id string
sequences int64 repeated

AcknowledgeAppDeathsResponse

AddMediaHeader

Field Type Label Description
client_connection_id string
attached_device_id string
file_name string 1-127 letters, digits, '.', '_', '-' or spaces, ending in a photo (jpg, jpeg, png, gif, webp, heic, heif, bmp) or video (mp4, 3gp, webm, mkv, mov) extension.
size_bytes int64

AddMediaRequest

Field Type Label Description
header AddMediaHeader
chunk bytes

AddMediaResponse

Field Type Label Description
device_path string where the media landed

AttachRequest

Field Type Label Description
client_connection_id string
serial string
skip_driver_install bool optional Skip installing the daemon's driver (bundled or tap serve --driver-apk): the device already has the right one.
default_timeout_ms int64 optional
lease_timeout_ms int64 optional How long to wait for another session's lock on the serial; absent = fail at once.
inspect_quarantined bool optional 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.
capture_logs bool optional 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.
driver_start DriverStartPolicy

AttachResponse

Field Type Label Description
attached_device_id string
serial string
generation int64
device_info DeviceInfo
quarantine_reason string optional Set when the attachment inspects a quarantined device: why it is quarantined.
driver_reused bool optional True only when this new session reused instrumentation; generation and credentials changed.

DetachRequest

Field Type Label Description
client_connection_id string
attached_device_id string

DetachResponse

Field Type Label Description
clean bool False when cleanup timed out or the session was quarantined; detail says why.
detail string optional

DeviceEntry

One listed device. Anything richer than the serial comes from DeviceInfo after attachment.

Field Type Label Description
serial string
state DeviceState
client_connection_id string optional The holding connection when this daemon holds it (LEASED); absent for another process.
quarantine_reason string optional
properties DeviceProperties optional 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.
retry_on_attach bool 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.
under_inspection bool 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.

DeviceLogsRequest

Field Type Label Description
client_connection_id string
attached_device_id string

DeviceLogsResponse

Field Type Label Description
logcat string 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.
logcat_truncated bool
crashes string 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.
activities string dumpsys activity activities and dumpsys window windows at the time of the call.
windows string

DeviceProperties

System properties of a device, read once per serial while it stays online.

Field Type Label Description
api_level int32 ro.build.version.sdk
manufacturer string ro.product.manufacturer
model string ro.product.model
emulator bool An Android emulator (ro.kernel.qemu or ro.boot.qemu is 1).

DriverLogRequest

Field Type Label Description
client_connection_id string
attached_device_id string

DriverLogResponse

Field Type Label Description
lines string repeated

ExecuteRequest

Field Type Label Description
client_connection_id string
attached_device_id string
command Command

ExecuteResponse

Field Type Label Description
result CommandResult

GetForegroundActivityRequest

Field Type Label Description
client_connection_id string
attached_device_id string

GetForegroundActivityResponse

Both set, or both absent when no activity is resumed.

Field Type Label Description
package_name string optional
activity string optional the fully qualified class name

ListAppDeathsRequest

Field Type Label Description
client_connection_id string
attached_device_id string
after_sequence int64 Only deaths with a larger AppDeath.sequence (0 = all).
package_name string optional Only this package's deaths (any of its processes).
sequence_only bool Return no deaths, only last_sequence: where a later call's after_sequence starts.
settle_ms int64 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.
wait_ms int64 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.

ListAppDeathsResponse

Field Type Label Description
deaths AppDeath repeated
last_sequence int64 The largest sequence recorded so far, whatever the filters (0 = none yet).

ListDevicesRequest

ListDevicesResponse

Field Type Label Description
devices DeviceEntry repeated

PullFileRequest

Field Type Label Description
client_connection_id string
attached_device_id string
device_path string

PullFileResponse

The first message carries size_bytes; every message may carry a chunk.

Field Type Label Description
size_bytes int64
chunk bytes

PushFileHeader

Field Type Label Description
client_connection_id string
attached_device_id string
device_path string
size_bytes int64 exact size; the upload is rejected on mismatch

PushFileRequest

Field Type Label Description
header PushFileHeader first message only
chunk bytes every later message

PushFileResponse

ResolveRefRequest

Field Type Label Description
client_connection_id string
attached_device_id string
ref string With or without the leading @.

ResolveRefResponse

Field Type Label Description
selector Selector
by_index bool
snapshot_id int64

ScreenNode

One visible node, in dump (pre-order) order.

Field Type Label Description
ref string e<N>. Stable across snapshots while the node is unchanged; never reused for another node.
depth int32
window_package string The package of the window root the node is under.
class_name string optional
resource_name string optional
text string optional
content_description string optional
hint string optional
bounds Bounds
flags NodeFlag repeated The boolean properties that are true (FLAG_EDITABLE for editable text, whatever its class).
password bool
interactive bool 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.
selector Selector optional A selector that matched only this node in the dump; absent when none was found.
by_index bool The selector ends in an At pick: correct for this dump, fragile if the screen reorders.
change NodeChange
candidates SelectorCandidate repeated 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.
showing_hint bool The field shows its hint, not a value (AccessibilityNodeInfo.isShowingHintText): text then holds the hint. False on a dump that does not report it.
content_invalid bool The app marked the content invalid (isContentInvalid), e.g. a field that failed validation.
error string optional The error the app set on the node (getError, e.g. TextView.setError).
window_index int32 One-based window ordinal in this dump, not a persistent Android window ID.
window_kind WindowKind What the node's window is, decided by the server for every client alike.
actions StandardAction repeated The standard actions the node offers that Tap can perform (Element.perform_action), in StandardAction order.
custom_actions string repeated The labels of the custom actions the node offers (Element.perform_custom_action).

ScreenSnapshotRequest

Field Type Label Description
client_connection_id string
attached_device_id string
timeout_ms int64 optional For the hierarchy dump; absent = the attached device's default command timeout.
selector_candidates bool Also fill ScreenNode.candidates (an inspector offering the user a choice of selectors).

ScreenSnapshotResponse

Field Type Label Description
snapshot_id int64 Increases per attached device.
nodes ScreenNode repeated
removed ScreenNode repeated Nodes of the previous snapshot that are gone; their refs no longer resolve.
rotation int32
display_width int32 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.
display_height int32
density_dpi int32

ScreenshotRequest

Field Type Label Description
client_connection_id string
attached_device_id string
timeout_ms int64 optional

ScreenshotResponse

Field Type Label Description
png bytes
sha256 string
width int32 optional
height int32 optional

SelectorCandidate

A selector that matched only its node in the dump.

Field Type Label Description
selector Selector
kind SelectorKind

SetAccessibilityDisplayRequest

At least one setting must be set; an absent one is left as it is.

Field Type Label Description
client_connection_id string
attached_device_id string
high_contrast_text bool optional
color_inversion bool optional
bold_text bool optional

SetAccessibilityDisplayResponse

SetAnimationsRequest

Field Type Label Description
client_connection_id string
attached_device_id string
enabled bool

SetAnimationsResponse

SetDarkModeRequest

Field Type Label Description
client_connection_id string
attached_device_id string
enabled bool

SetDarkModeResponse

SetDensityRequest

Field Type Label Description
client_connection_id string
attached_device_id string
dpi int32 optional Absent: remove the override (the display's physical density).

SetDensityResponse

SetFontScaleRequest

Field Type Label Description
client_connection_id string
attached_device_id string
scale float

SetFontScaleResponse

SetLocationRequest

Field Type Label Description
client_connection_id string
attached_device_id string
latitude double
longitude double
accuracy_m float optional
altitude_m double optional

SetLocationResponse

SetNetworkRequest

At least one switch must be set; an absent one is left as it is.

Field Type Label Description
client_connection_id string
attached_device_id string
airplane_mode bool optional
wifi bool optional
mobile_data bool optional

SetNetworkResponse

SetShowImeWithHardKeyboardRequest

Field Type Label Description
client_connection_id string
attached_device_id string
enabled bool

SetShowImeWithHardKeyboardResponse

SetStayAwakeRequest

Field Type Label Description
client_connection_id string
attached_device_id string
enabled bool

SetStayAwakeResponse

SetSystemLocalesRequest

Field Type Label Description
client_connection_id string
attached_device_id string
locales string repeated

SetSystemLocalesResponse

StartRecordingRequest

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).

Field Type Label Description
client_connection_id string
attached_device_id string
video bool
audio_source string 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).
max_seconds int32 Absent/zero = 30 s with video, 60 s audio only. Max 30 s video / 60 s audio.

StartRecordingResponse

StopRecordingRequest

Field Type Label Description
client_connection_id string
attached_device_id string

StopRecordingResponse

Field Type Label Description
data bytes ≤16 MiB video, ≤3 MiB audio-only
format string mp4, mkv, opus
sha256 string

UnquarantineRequest

Field Type Label Description
serial string

UnquarantineResponse

Field Type Label Description
was_quarantined bool False when the device was not quarantined: nothing was done.
quarantine_reason string Why it had been quarantined.
cleaned string repeated What the cleanup retry put right, one line each.
remaining string repeated What it could not; the device keeps it.

DeviceState

State of a listed device.

Name Number Description
DEVICE_STATE_UNSPECIFIED 0
DEVICE_FREE 1
DEVICE_LEASED 2
DEVICE_QUARANTINED 3
DEVICE_OFFLINE 4
DEVICE_UNAUTHORIZED 5

DriverStartPolicy

Runtime reuse never resumes the previous session: identity, credentials and state are fresh.

Name Number Description
DRIVER_START_POLICY_UNSPECIFIED 0 daemon default (AUTO)
DRIVER_START_AUTO 1 reuse only a proven-clean daemon-owned runtime, otherwise cold
DRIVER_START_COLD 2 start fresh instrumentation and stop it on detach

NodeChange

A node against the previous snapshot of the same attached device.

Name Number Description
NODE_CHANGE_UNSPECIFIED 0 there was no previous snapshot
NODE_ADDED 1
NODE_UNCHANGED 2
NODE_REMOVED 3

SelectorKind

How a synthesised selector singles out its node.

Name Number Description
SELECTOR_KIND_UNSPECIFIED 0
SELECTOR_KIND_PLAIN 1 One predicate: resource id, text, description or hint.
SELECTOR_KIND_COMBINED 2 Two predicates of the node itself (resource and text, text and class, ...).
SELECTOR_KIND_ANCESTOR 3 The node's own predicate plus an ancestor relation to an addressable ancestor.
SELECTOR_KIND_BY_INDEX 4 All of the node's predicates plus an At pick: correct for this dump, fragile if the screen reorders.

WindowKind

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.

Name Number Description
WINDOW_KIND_UNSPECIFIED 0
WINDOW_KIND_APPLICATION 1
WINDOW_KIND_INPUT_METHOD 2
WINDOW_KIND_SYSTEM 3
WINDOW_KIND_ACCESSIBILITY_OVERLAY 4
WINDOW_KIND_SPLIT_SCREEN_DIVIDER 5
WINDOW_KIND_MAGNIFICATION_OVERLAY 6
WINDOW_KIND_STATUS_BAR 7
WINDOW_KIND_NAVIGATION_BAR 8

DeviceService

Method Name Request Type Response Type Description
ListDevices ListDevicesRequest ListDevicesResponse
Unquarantine UnquarantineRequest UnquarantineResponse 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.
Attach AttachRequest AttachResponse
Detach DetachRequest DetachResponse
GetDeviceCapabilities GetDeviceCapabilitiesRequest GetDeviceCapabilitiesResponse 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.
Execute ExecuteRequest ExecuteResponse
WatchDeviceEvents WatchDeviceEventsRequest WatchDeviceEventsResponse stream 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.
Screenshot ScreenshotRequest ScreenshotResponse
DriverLog DriverLogRequest DriverLogResponse
DeviceLogs DeviceLogsRequest DeviceLogsResponse 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.
ListAppDeaths ListAppDeathsRequest ListAppDeathsResponse 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.
AcknowledgeAppDeaths AcknowledgeAppDeathsRequest AcknowledgeAppDeathsResponse 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.
StartRecording StartRecordingRequest StartRecordingResponse One optional host-managed scrcpy capture per attachment (video, audio or both); the driver never encodes media. Requires scrcpy on the daemon host.
StopRecording StopRecordingRequest StopRecordingResponse
ScreenSnapshot ScreenSnapshotRequest ScreenSnapshotResponse 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.
ResolveRef ResolveRefRequest ResolveRefResponse 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).
SetAnimations SetAnimationsRequest SetAnimationsResponse 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.
SetDarkMode SetDarkModeRequest SetDarkModeResponse cmd uimode night yes|no. API 29+ (FAILED_PRECONDITION, UNSUPPORTED_API below).
SetFontScale SetFontScaleRequest SetFontScaleResponse The system font scale (font_scale), 0.5 to 2.0.
SetDensity SetDensityRequest SetDensityResponse wm density: an override in dpi (100 to 1000), or absent for the display's physical density.
SetNetwork SetNetworkRequest SetNetworkResponse 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).
SetSystemLocales SetSystemLocalesRequest SetSystemLocalesResponse 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).
SetLocation SetLocationRequest SetLocationResponse 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).
SetStayAwake SetStayAwakeRequest SetStayAwakeResponse 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.
SetShowImeWithHardKeyboard SetShowImeWithHardKeyboardRequest SetShowImeWithHardKeyboardResponse 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.
SetAccessibilityDisplay SetAccessibilityDisplayRequest SetAccessibilityDisplayResponse 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.
GetForegroundActivity GetForegroundActivityRequest GetForegroundActivityResponse The activity on top (resumed), from dumpsys activity activities; empty when none is resumed (a keyguard, or between activities). Changes nothing.
PushFile PushFileRequest stream PushFileResponse 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. |

device_log.proto

LogAction

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.

Field Type Label Description
operation string The operation in snake_case: a command's name (tap, wait_visible), an AppService call (launch) or a DeviceService call (set_network).
target string optional What it acted on: the rendered selector of a command, the package of an app call. Never an argument such as typed text.
finished bool
outcome string optional With finished: ok, a command error code (NOT_FOUND) or a failure reason (APP_LIFECYCLE).
duration_ms int64 optional
request_id int64 optional Driver commands: the request the driver answered (CommandResult.request_id) and the device clock when it logged the line.
device_time_ms int64 optional
step string optional 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.

LogEntry

Field Type Label Description
cursor uint64 1, 2, 3, … per attachment, in the order the daemon got the entries; never reused.
host_time_ms int64 The daemon host's clock when it got the entry, the clock LoggedEvent.at_epoch_ms is on.
line LogLine
marker string MarkLog: the marker's name.
action LogAction
gap string The capture was interrupted here (the device disconnected, logcat ended) and lines may be missing: why.
host_monotonic_ns int64 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).

LogLine

One logcat line. A message of several lines arrives as several entries.

Field Type Label Description
device_time_ms int64 The device's clock, which need not agree with the host's.
uid uint32 optional The Linux uid of the process that logged it; absent when logcat did not print a number.
pid uint32
tid uint32
priority LogPriority
tag string
message string
packages string repeated 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.
packages_observed_at_ms int64 optional When that package map was read. Absent means ownership was unavailable (also on older retained lines); the uid and device time are still preserved.

MarkLogRequest

Field Type Label Description
client_connection_id string
attached_device_id string
name string 1 to 200 characters, no line breaks.

MarkLogResponse

Field Type Label Description
cursor uint64 The marker's entry.

ReadLogRequest

Field Type Label Description
client_connection_id string The live connection that owns attached_device_id. This is routing, not authentication.
attached_device_id string
after_cursor uint64 Entries after this cursor (LogEntry.cursor, or MarkLogResponse.cursor).
marker string From the newest marker with this name, the marker included. NOT_FOUND when there is none.
tail uint32 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.
last_action bool From the start of the newest action, that entry included; everything when there is none.
follow bool Keep the stream open for entries logged after the call.
packages string repeated 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.
min_priority LogPriority Lines of this priority or higher; absent = all.
tags string repeated Lines with one of these tags, compared exactly.
message_regex string optional Lines whose message contains a match of this regular expression (java.util.regex syntax), tested after redaction.
exclude_actions bool Leave the action entries out.
step string optional 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.

ReadLogResponse

Field Type Label Description
entries LogEntry repeated
dropped uint64 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.
capture_error string Why the daemon could not keep all of this attachment's log (a storage limit or failure); empty when it kept everything.
clock_id string The daemon run whose monotonic clock LogEntry.host_monotonic_ns is on.

RedactLogRequest

Field Type Label Description
client_connection_id string
attached_device_id string
patterns string repeated 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).

RedactLogResponse

LogPriority

Name Number Description
LOG_PRIORITY_UNSPECIFIED 0
LOG_PRIORITY_VERBOSE 1
LOG_PRIORITY_DEBUG 2
LOG_PRIORITY_INFO 3
LOG_PRIORITY_WARN 4
LOG_PRIORITY_ERROR 5
LOG_PRIORITY_FATAL 6

DeviceLogService

Method Name Request Type Response Type Description
ReadLog ReadLogRequest ReadLogResponse stream 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.
MarkLog MarkLogRequest MarkLogResponse Writes a named marker into the log, at the time the daemon gets the call.
RedactLog RedactLogRequest RedactLogResponse Adds patterns whose matches are replaced by <redacted> in everything read from now on, lines already captured included.

history.proto

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).

DeleteHistoryRecordingRequest

Field Type Label Description
recording_id string

DeleteHistoryRecordingResponse

HistoryConnectionSource

One connection's calls and the crashes and ANRs seen on its devices.

Field Type Label Description
connection_id string

HistoryDeath

A crash or ANR, with the attachment it happened in. AppDeath.at_epoch_ms is the device's clock; HistoryEntry.received_at_ms is when the daemon saw it.

Field Type Label Description
attached_device_id string
serial string
death AppDeath

HistoryDeviceSource

One attachment's device log: logcat lines, Tap's actions on the device and markers.

Field Type Label Description
connection_id string
attached_device_id string
serial string

HistoryEntry

Field Type Label Description
source_id string
sequence uint64 1, 2, 3, … per source, in the order the daemon received the entries.
received_at_ms int64 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.
received_monotonic_ns int64 The daemon's monotonic clock at receipt; compare only within one HistorySource.clock_id.
line LogLine Device-log sources: the source's serial is the device.
action LogAction
marker string The name given to MarkLog.
call LoggedEvent Connection sources.
death HistoryDeath
gap string Either kind: capture stopped here and entries may be missing until the next one: why.

HistoryIssue

Field Type Label Description
source_id string Empty when the issue is not about one source (a recording's own storage error).
kind HistoryIssueKind
message string Redacted, short and readable; never an exception trace or a command's output.
missing_entries uint64 EXPIRED: how many of the source's entries were removed, counted before filters; 0 when not known.

HistoryLogFilter

Which device-log lines to return. Actions, markers and gaps are kept by every line filter; calls and deaths are never filtered by it.

Field Type Label Description
packages string repeated 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.
min_priority LogPriority Lines of this priority or higher; absent = all.
tags string repeated
message_regex string optional Java regular expression, matched against the redacted message.
exclude_actions bool Leave Tap's own action entries out.
include_driver_lines bool Keep the Tap driver's own logcat lines, left out by default.

HistoryPageInfo

Field Type Label Description
next_cursor string Pass as ReadHistoryRequest.cursor for the next page; empty when there is none.
through_time_ms int64 The read's end in Unix milliseconds (exclusive), fixed by its first page.

HistoryRecording

Field Type Label Description
id string Names the recording in reads and controls; stays valid after its connection ends.
connection_id string
name string Unique among this connection's recordings, not across the daemon.
started_at_ms int64
stopped_at_ms int64 optional Absent while recording.
spans HistorySpan repeated One per source; a device attached during the recording adds its span then.
issues HistoryIssue repeated
retained_bytes uint64 Bytes on disk the spans need. Other sources may share them, so deleting the recording can free less.

HistorySelection

Every nonempty list must match (AND across lists); within a list any value matches (OR). Nothing set selects every kept source.

Field Type Label Description
connection_ids string repeated
source_ids string repeated
serials string repeated The device logs of these serials, and only the calls and deaths on these serials.
recording_id string optional Only this recording's range, also after its connection ended.

HistorySource

Field Type Label Description
id string Names the source in entries, spans and issues.
device_log HistoryDeviceSource
connection HistoryConnectionSource
clock_id string The daemon run that captured the source: received_monotonic_ns values compare only between entries with the same clock id.
closed bool The connection ended or the device was detached; nothing more will be added.
last_sequence uint64 In ListHistorySources, the newest entry's sequence. In a read, the newest sequence the read covers, fixed by its first page.
retained_bytes uint64 Bytes on disk, some of which may be shared with other sources' files.
issues HistoryIssue repeated In ListHistorySources only; a read reports every issue once, in ReadHistoryResponse.issues.

HistorySpan

The part of one source a recording keeps: after after_sequence, through through_sequence (absent while recording).

Field Type Label Description
source_id string
after_sequence uint64
through_sequence uint64 optional

ListHistoryRecordingsRequest

Field Type Label Description
connection_ids string repeated Only these connections' recordings; empty = all.

ListHistoryRecordingsResponse

Field Type Label Description
recordings HistoryRecording repeated

ListHistorySourcesRequest

Field Type Label Description
selection HistorySelection

ListHistorySourcesResponse

Field Type Label Description
sources HistorySource repeated

ReadHistoryRequest

Field Type Label Description
selection HistorySelection
from_time_ms int64 Entries the daemon received at or after this time, in Unix milliseconds.
from_marker string 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.
until_time_ms int64 Entries the daemon received before this time, in Unix milliseconds.
until_marker string 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.
step string optional 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.
include_logs bool Add device logs. Without it a read returns calls, deaths and gaps only.
log_filter HistoryLogFilter Only with include_logs; INVALID_ARGUMENT otherwise.
newest_first bool Newest entries first: with limit, the most recent ones in the range.
limit uint32 1 to 5000 entries per page; 0 = 200. A page is also cut at a few MiB.
cursor string optional 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.

ReadHistoryResponse

Field Type Label Description
sources HistorySource repeated The sources this read covers, entries or not.
entries HistoryEntry repeated
issues HistoryIssue repeated
page HistoryPageInfo

StartHistoryRecordingRequest

Field Type Label Description
connection_id string
name string 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.

StartHistoryRecordingResponse

Field Type Label Description
recording HistoryRecording

StopHistoryRecordingRequest

Field Type Label Description
recording_id string

StopHistoryRecordingResponse

Field Type Label Description
recording HistoryRecording

HistoryIssueKind

Name Number Description
HISTORY_ISSUE_KIND_UNSPECIFIED 0
HISTORY_ISSUE_KIND_EXPIRED 1 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.

HistoryService

Method Name Request Type Response Type Description
ListHistorySources ListHistorySourcesRequest ListHistorySourcesResponse The kept sources, including those of ended connections and detached devices.
ReadHistory ReadHistoryRequest ReadHistoryResponse 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.
StartHistoryRecording StartHistoryRecordingRequest StartHistoryRecordingResponse 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.
StopHistoryRecording StopHistoryRecordingRequest StopHistoryRecordingResponse Ends the recording's range. Stopping a stopped recording returns it unchanged.
ListHistoryRecordings ListHistoryRecordingsRequest ListHistoryRecordingsResponse
DeleteHistoryRecording DeleteHistoryRecordingRequest DeleteHistoryRecordingResponse Deletes a stopped recording, so retention may remove its entries. Files saved separately (screenshots, captures) are not touched. FAILED_PRECONDITION while it is recording.

watch.proto

Activity

One thing that happened, numbered 1, 2, 3, … for the daemon's lifetime.

Field Type Label Description
seq int64
at_epoch_ms int64
client_connection_id string
connection_opened ConnectionOpened
connection_closed ConnectionClosed
device_attached DeviceAttached
device_detached DeviceDetached
event LoggedEvent A call the connection made, exactly as its own event log (Events) records it.

ConnectionClosed

Field Type Label Description
reason string

ConnectionOpened

Field Type Label Description
name string
held bool Set for a held connection.

DeviceAttached

Field Type Label Description
attached_device_id string
serial string
generation int64

DeviceDetached

Field Type Label Description
attached_device_id string
serial string
reason string "detached", or why its connection ended.

VideoFrame

Field Type Label Description
seq uint64 1, 2, 3, … per stream_id.
pts_us int64
key_frame bool
data bytes
received_monotonic_ns int64 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.
received_epoch_ms int64

VideoHeader

Field Type Label Description
stream_id string
clock_id string
width uint32
height uint32
configuration bytes H.264 Annex B SPS/PPS. A new header resets the decoder.

WatchLogRequest

Field Type Label Description
attached_device_id string DeviceAttached.attached_device_id.
after_cursor uint64 Only entries with a larger cursor; 0 for everything the daemon still has.

WatchLogResponse

Field Type Label Description
entries LogEntry repeated
dropped uint64 First response only: entries after after_cursor the daemon had already forgotten.
clock_id string First response only: the clock of the entries' host_monotonic_ns.

WatchRequest

Field Type Label Description
after_seq int64 Only activity with a larger seq; 0 for the whole retained backlog. Must be >= 0.

WatchResponse

Field Type Label Description
connections ConnectionEntry repeated First response only: every live connection with its attached devices when the stream began.
activities Activity repeated In seq order. The first response holds the backlog (possibly empty); later ones are live.
dropped int64 Activities evicted from the daemon's log since it started (it keeps the last 10000).

WatchVideoRequest

Field Type Label Description
serial string

WatchVideoResponse

Field Type Label Description
header VideoHeader
frame VideoFrame

WatchService

Method Name Request Type Response Type Description
Watch WatchRequest WatchResponse stream 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.
WatchVideo WatchVideoRequest WatchVideoResponse stream 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.
WatchLog WatchLogRequest WatchLogResponse stream 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.

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)