Skip to content

Click Operation

Execute click operation at specified coordinate position.

Interface Description

Interface Type

click

Parameters

ParameterTypeRequiredDefaultDescription
deviceIdstring-Device ID
xnumber-Click X coordinate (pixels)
ynumber-Click Y coordinate (pixels)
focusbooleanfalseWhether to attempt focus before clicking
delaynumberfalseClick to release delay

Return Value

javascript
true  // Returns true on successful operation

Basic Usage

Simple Click

javascript
// Click screen coordinate (100, 200)
await apiInvoke('click', {
    deviceId: 'P72578581E07',
    x: 100,
    y: 200
});

focus Parameter?

⚠️ Use in Specific Scenarios

The focus parameter is only for specific scenarios

✅ Applicable Scenarios: System-level Alert Buttons

System-level alert boxes (such as permission requests, system popups, etc.) buttons sometimes cannot respond to normal click events. In this case, use focus: true:

Examples of Applicable System-level Alerts:

  • 📱 Permission request popups (camera, location, notifications, etc.)
  • 🔐 System security alerts
  • ⚙️ System settings related popups
  • 🔔 iOS system-level confirmation dialogs

❌ Not Applicable: Normal App Interfaces

For normal buttons and UI elements in apps, do not use focus: true

❓ Does focus: true Affect Performance?

It will slightly increase execution time.

Cooperation: try.catch@foxmail.com