/** * adb plumbing for the Android driver: the exec seam tests stub, executable discovery, * device listing, keycode mapping, and shell-safe text. * * Ported mechanism-for-mechanism from mirasim's simulator android provider. Device * DISCOVERY picks emulators only — grabbing whatever phone is plugged in brings * USB/authorisation/vendor-skin variance nobody asked for. An explicitly named serial * is honored verbatim (tcp devices, redroid, phones): that is the caller's call. */ /** One finished process. stdout stays a Buffer because screencap output is binary PNG. */ export interface ExecResult { stdout: Buffer; stderr: string; code: number; } /** The seam every adb call goes through, so tests can stub the device away. */ export type ExecFn = (file: string, args: string[], opts?: { timeoutMs?: number; }) => Promise; export declare const realExec: ExecFn; /** adb binary: explicit env, then PATH, then the default SDK install locations. */ export declare function findAdb(): string | null; /** The user-facing dead end when no adb exists. Names every way out. */ export declare function adbMissingError(): Error; export interface AdbDevice { serial: string; emulator: boolean; } /** `adb devices` rows in state `device` (booting/offline/unauthorized rows are not operable). */ export declare function listDevices(exec: ExecFn, adb: string): Promise; /** The dead end when adb answers but no emulator is running. Names the fix — and names * any physical devices it is refusing, so "but my phone is plugged in" has its answer. */ export declare function noEmulatorError(devices: AdbDevice[]): Error; /** `input keyevent` codes for the chords gui_act's `keys` verb accepts. */ export declare const KEYCODES: Record; /** Resolve a `keys` chord to an Android keycode; null = unknown (adb cannot post modifier * chords like Ctrl+A, so those fail honestly instead of pressing something else). */ export declare function keycodeOf(chord: string): number | null; /** `input text` goes through a shell on the device, so spaces and metacharacters must go * (space becomes %s — the encoding `input text` itself defines). */ export declare function androidTextEscape(text: string): string;