Automation API

Android device automation

AgentInfo

Interface

Get automation and device metadata

Access these methods through agent.info. Provides information about the current automation and the device it's running on.

AgentInfo Interface
TypeScript
interface AgentInfo {
getAutomationInfo(): AutomationInfo;
getDeviceInfo(): DeviceInfo;
getPhoneNumber(): string | null; // Since 2.138
getVerifiedPhoneNumber(): Promise<string | null>;
getDeviceInfoFromServer(): Promise<
| { success: false; message: string }
| { success: true; info: DeviceInfoFromServer }
>;
}

Methods

getAutomationInfo()

TypeScript
getAutomationInfo(): AutomationInfo

Returns metadata about the currently running automation.

Returns

AutomationInfoAutomation metadata

Examples

TypeScript
const info = agent.info.getAutomationInfo();
console.log("Running:", info.name);
console.log("Launch ID:", info.launchId);
console.log("Server:", info.serverBaseUrl);

getDeviceInfo()

TypeScript
getDeviceInfo(): DeviceInfo

Returns information about the device hardware and configuration.

Returns

DeviceInfoDevice specifications

Examples

TypeScript
const device = agent.info.getDeviceInfo();
console.log("Device:", device.brand, device.model);
console.log("Screen:", device.width, "x", device.height);
console.log("Android SDK:", device.sdkVersion);
console.log("Is Emulator:", device.isEmulator);
// Since app 3.9.2: permission state read live on the device
if (device.notificationAccessGranted === false) {
console.log("Notification access is not granted");
}
if (device.xgodoKeyboardEnabled && device.xgodoKeyboardActive) {
console.log("XGODO keyboard is enabled and is the active keyboard");
}

getPhoneNumber()

TypeScript
getPhoneNumber(): string | null

Returns the phone number of the device's SIM card. Returns null if unavailable (no SIM inserted, permission not granted, or carrier doesn't provide the number). Requires phone/SMS permissions to be granted on the device.Since 2.138 (150)

Returns

string | nullPhone number string or null if unavailable

Examples

TypeScript
const phoneNumber = agent.info.getPhoneNumber();
if (phoneNumber) {
console.log("Device phone number:", phoneNumber);
} else {
console.log("Phone number not available");
}

getVerifiedPhoneNumber()

TypeScript
getVerifiedPhoneNumber(): Promise<string | null>

Returns the phone number stored on the device record on the server, only if it has been marked verified there. Resolves to null when the device has no verified phone number, the agent token is missing (i.e. the automation is not running through a job/agent), or the request fails. Differs from getPhoneNumber, which reads the SIM directly on the device. Backed by GET /api/v2/devices/verified-phone-number.

Returns

Promise<string | null>Verified phone number from the device record, or null if not verified / unavailable

Examples

TypeScript
const verified = await agent.info.getVerifiedPhoneNumber();
if (verified) {
console.log("Verified phone number:", verified);
} else {
console.log("No verified phone number on file");
}

getDeviceInfoFromServer()

TypeScript
getDeviceInfoFromServer(): Promise<{ success: false; message: string } | { success: true; info: DeviceInfoFromServer }>

Returns the server's last-known status of this device: battery level and charging, online/network state, ADB and screen-capture state, screen lock, notification access, XGODO keyboard, signal, memory, storage, power-save mode, granted/missing permissions, and whether a device password is saved (never the password itself). These are the values the app last reported, so they can lag behind the device by a few minutes; check the *UpdatedAt fields. Use getDeviceInfo for values read live on the device. On failure it resolves to { success: false, message } saying why: no agent token (the automation is not running through a job/agent), an HTTP error from the server, or a network error. Backed by GET /api/v2/devices/agent-device-info.

Returns

Promise<{ success: false; message: string } | { success: true; info: DeviceInfoFromServer }>The device status in info, or a message explaining the failure

Examples

TypeScript
const result = await agent.info.getDeviceInfoFromServer();
if (!result.success) {
console.error("Couldn't get device info:", result.message);
} else {
const { info } = result;
console.log("Battery:", info.batteryLevel, info.isCharging ? "(charging)" : "");
console.log("Network:", info.networkType, "signal", info.signalLevel);
console.log("Free storage (MB):", info.availableStorageMb);
}

Types

AutomationInfo

Contains metadata about the running automation.

TypeScript
interface AutomationInfo {
name: string; // Automation name
description: string; // Automation description
launchId: string; // Unique ID for this launch
agent?: { // Optional agent details
id: string;
commitId: string;
token: string;
jobTaskId: string;
};
serverBaseUrl: string; // Server URL for API calls
timeout?: number; // Optional timeout in minutes available since app v2.123 (135)
}

AutomationInfo Properties

PropertyTypeDescription
namestringThe name of the automation
descriptionstringDescription of what the automation does
launchIdstringUnique identifier for this execution
agent?objectAgent details when running in agent mode (id, commitId, token, jobTaskId)
serverBaseUrlstringBase URL of the server for API calls
timeout?numberOptional timeout for the automation in minutes (since v2.123 (135))

DeviceInfo

Contains hardware and configuration information about the device.

TypeScript
interface DeviceInfo {
id: string; // Unique device ID
brand: string; // Device brand (e.g., "Samsung")
model: string; // Device model (e.g., "SM-G991B")
sdkVersion: number; // Android SDK version (e.g., 33)
processor: string; // CPU info
numberOfCores: number; // CPU core count
ramMb: number; // RAM in megabytes
country: string; // Device country
isEmulator: boolean; // true if running on emulator
width: number; // Screen width in pixels
height: number; // Screen height in pixels
appVersionName: string; // RemoteMobile app version name (e.g., "2.141")
appVersionCode: number; // RemoteMobile app version code (e.g., 195)
devicePassword: string | null; // Screen-lock PIN/password set in device settings
notificationAccessGranted: boolean | null; // Since 3.9.2
xgodoKeyboardEnabled: boolean | null; // Since 3.9.2
xgodoKeyboardActive: boolean | null; // Since 3.9.2
}

DeviceInfo Properties

PropertyTypeDescription
idstringUnique identifier for the device
brandstringDevice manufacturer (e.g., 'Samsung', 'Google')
modelstringDevice model name
sdkVersionnumberAndroid SDK API level (e.g., 33 for Android 13)
processorstringCPU/processor information
numberOfCoresnumberNumber of CPU cores
ramMbnumberTotal RAM in megabytes
countrystringDevice country/region setting
isEmulatorbooleanWhether the device is an emulator
widthnumberScreen width in pixels
heightnumberScreen height in pixels
appVersionNamestringRemoteMobile app version name string (e.g., "2.141")
appVersionCodenumberRemoteMobile app version code integer (e.g., 195). Use to gate features added in a specific app version.
devicePasswordstring | nullThe device's screen-lock PIN or password, as saved by the owner on the device settings page. Sent with every automation start; null when not set (or on app builds older than 3.9.2). Use it to unlock the device when the lock screen appears.
notificationAccessGrantedboolean | nullWhether the XGODO app has notification access, read live on the device. null if it couldn't be read. Missing on app builds older than 3.9.2.
xgodoKeyboardEnabledboolean | nullWhether the XGODO keyboard is enabled in the device's keyboard settings, read live. null if it couldn't be read. Missing on app builds older than 3.9.2.
xgodoKeyboardActiveboolean | nullWhether the XGODO keyboard is the device's current keyboard, read live. null if it couldn't be read. Missing on app builds older than 3.9.2.

DeviceInfoFromServer

The server's last-known status of the device, as returned by getDeviceInfoFromServer. Fields the app hasn't reported yet are null.

TypeScript
interface DeviceInfoFromServer {
remote_device_id: string; // Same as getDeviceInfo().id
name: string;
status: "started" | "stopped";
brand: string;
model: string;
sdkVersion: number;
processor: string;
numberOfCores: number;
ramMb: number;
country: string;
isEmulator: boolean;
version: string; // App version name
versionCode: number; // App version code
online: boolean;
statusUpdatedAt: number; // epoch ms
networkType: "wifi" | "mobile" | "unknown";
batteryLevel: number | null; // 0-100
batteryUpdatedAt: number; // epoch ms
isCharging: boolean;
isAssistant: boolean;
isAdbConnected: boolean;
isMediaProjectionActive: boolean;
mediaProjectionUpdatedAt: string | null;
isScreenLockSet: boolean | null;
screenLockUpdatedAt: string | null;
notificationAccessGranted: boolean | null;
notificationListenerConnected: boolean;
deviceLanguage: string | null;
deviceTimezone: string | null;
signalLevel: number | null; // 0-4
signalDbm: number | null;
carrierName: string | null;
availableRamMb: number | null;
isLowMemory: boolean | null;
availableStorageMb: number | null;
totalStorageMb: number | null;
isPowerSaveMode: boolean | null;
xgodoKeyboardEnabled: boolean | null;
xgodoKeyboardActive: boolean | null;
deviceStatsUpdatedAt: string | null;
granted_permissions: string[];
missing_permissions: string[];
permissions_updated_at: string | null;
has_device_password: boolean; // Whether a password is saved (never the value)
device_password_check_result: "supported" | "not_supported" | null; // Last unlock check
device_password_check_at: string | null;
}

Usage Example

TypeScript
// Adapt automation to device capabilities
const device = agent.info.getDeviceInfo();
// Calculate center of screen
const centerX = device.width / 2;
const centerY = device.height / 2;
// Check Android version for feature availability
if (device.sdkVersion >= 33) {
// Use Android 13+ features
}
// Log automation context
const automation = agent.info.getAutomationInfo();
console.log(`Running "${automation.name}" on ${device.brand} ${device.model}`);