Skip to content

Automation API

Android device automation

agent.actions.apps

Actions

Launch apps, manage intents, and browse URLs.

Access these methods through agent.actions. Launch and manage applications on the device.

launchApp()

TypeScript
launchApp(packageName: string, clearExisting?: boolean): Promise<void>

Launches an app by its package name.

Parameters

NameTypeDescription
packageNamestringThe app's package name (e.g., 'com.android.settings').
clearExisting?booleanClose the existing app before launching. (default: false)

Returns

Promise<void>Resolves when app is launched.

Examples

TypeScript
await agent.actions.launchApp("com.android.settings");
Launch with fresh data
TypeScript
await agent.actions.launchApp("com.example.app", true);

launchIntent()

TypeScript
launchIntent(intentName: string, packageName: string | null, data: string | null, type: string | null, extras: object | null, flags: number, component: "activity" | "service" | "broadcast", isDataLocal?: boolean): Promise<void>

Launches an Android Intent with full configuration options.

Parameters

NameTypeDescription
intentNamestringAction name (e.g., "android.intent.action.VIEW").
packageNamestring | nullTarget package name.
datastring | nullIntent data URI.
typestring | nullMIME type.
extrasobject | nullExtra data as key-value pairs.
flagsnumberIntent flags.
component"activity" | "service" | "broadcast"Component type to launch.
isDataLocal?booleanIf true, data is a local file path.

Returns

Promise<void>Resolves when intent is launched.

Examples

Open a URL
TypeScript
await agent.actions.launchIntent(
"android.intent.action.VIEW",
null,
"https://example.com",
null, null, 0, "activity"
);

listApps()

TypeScript
listApps(): Promise<{[packageName: string]: string}>

Gets a list of all installed apps.

Returns

{[packageName: string]: string}Object mapping package names to app display names.

Examples

TypeScript
const apps = await agent.actions.listApps();
console.log(apps["com.android.chrome"]); // "Chrome"

browse()

TypeScript
browse(url: string, clearExistingData?: boolean): Promise<void>

Opens a URL in the default browser.

Parameters

NameTypeDescription
urlstringURL to open.
clearExistingData?booleanClear browser data before opening.

Returns

Promise<void>Resolves when browser is launched.

Examples

TypeScript
await agent.actions.browse("https://example.com");