Skip to content

Automation API

Android device automation

agent.actions.navigation

Actions

Device navigation and system button actions.

Access these methods through agent.actions. Navigate between screens and interact with system buttons.

goHome()

TypeScript
goHome(): Promise<void>

Returns to the home screen.

Returns

Promise<void>Resolves when navigation is complete.

Examples

TypeScript
await agent.actions.goHome();

goBack()

TypeScript
goBack(): Promise<void>

Presses the system back button.

Returns

Promise<void>Resolves when back action is complete.

Examples

TypeScript
await agent.actions.goBack();

recents()

TypeScript
recents(): Promise<void>

Opens the recent apps screen.

Returns

Promise<void>Resolves when recent apps screen is shown.

Examples

TypeScript
await agent.actions.recents();

dpad()

TypeScript
dpad(direction: "up" | "down" | "left" | "right" | "center"): Promise<void>

Sends a D-pad navigation event. Useful for navigating lists and menus. Requires Android 13+ (SDK level 33+).

Parameters

NameTypeDescription
direction"up" | "down" | "left" | "right" | "center"Direction to navigate.

Returns

Promise<void>Resolves when navigation is complete.

Examples

TypeScript
await agent.actions.dpad("down");
TypeScript
await agent.actions.dpad("center"); // Select/Enter
Note: dpad() requires Android 13+ (SDK level 33+). Check the device SDK version using agent.info.getDeviceInfo().sdkVersion.