AgentInfo
InterfaceGet automation and device metadata
Access these methods through agent.info. Provides information about the current automation and the device it's running on.
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()
getAutomationInfo(): AutomationInfoReturns metadata about the currently running automation.
Returns
AutomationInfoAutomation metadata
Examples
const info = agent.info.getAutomationInfo();console.log("Running:", info.name);console.log("Launch ID:", info.launchId);console.log("Server:", info.serverBaseUrl);getDeviceInfo()
getDeviceInfo(): DeviceInfoReturns information about the device hardware and configuration.
Returns
DeviceInfoDevice specifications
Examples
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 deviceif (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()
getPhoneNumber(): string | nullReturns 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
const phoneNumber = agent.info.getPhoneNumber();if (phoneNumber) { console.log("Device phone number:", phoneNumber);} else { console.log("Phone number not available");}getVerifiedPhoneNumber()
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
const verified = await agent.info.getVerifiedPhoneNumber();if (verified) { console.log("Verified phone number:", verified);} else { console.log("No verified phone number on file");}getDeviceInfoFromServer()
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
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.
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
| Property | Type | Description |
|---|---|---|
name | string | The name of the automation |
description | string | Description of what the automation does |
launchId | string | Unique identifier for this execution |
agent? | object | Agent details when running in agent mode (id, commitId, token, jobTaskId) |
serverBaseUrl | string | Base URL of the server for API calls |
timeout? | number | Optional timeout for the automation in minutes (since v2.123 (135)) |
DeviceInfo
Contains hardware and configuration information about the device.
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
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for the device |
brand | string | Device manufacturer (e.g., 'Samsung', 'Google') |
model | string | Device model name |
sdkVersion | number | Android SDK API level (e.g., 33 for Android 13) |
processor | string | CPU/processor information |
numberOfCores | number | Number of CPU cores |
ramMb | number | Total RAM in megabytes |
country | string | Device country/region setting |
isEmulator | boolean | Whether the device is an emulator |
width | number | Screen width in pixels |
height | number | Screen height in pixels |
appVersionName | string | RemoteMobile app version name string (e.g., "2.141") |
appVersionCode | number | RemoteMobile app version code integer (e.g., 195). Use to gate features added in a specific app version. |
devicePassword | string | null | The 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. |
notificationAccessGranted | boolean | null | Whether 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. |
xgodoKeyboardEnabled | boolean | null | Whether 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. |
xgodoKeyboardActive | boolean | null | Whether 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.
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
// Adapt automation to device capabilitiesconst device = agent.info.getDeviceInfo();
// Calculate center of screenconst centerX = device.width / 2;const centerY = device.height / 2;
// Check Android version for feature availabilityif (device.sdkVersion >= 33) { // Use Android 13+ features}
// Log automation contextconst automation = agent.info.getAutomationInfo();console.log(`Running "${automation.name}" on ${device.brand} ${device.model}`);