Click Operation
Execute click operation at specified coordinate position.
Interface Description
Interface Type
clickParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
deviceId | string | ✅ | - | Device ID |
x | number | ✅ | - | Click X coordinate (pixels) |
y | number | ✅ | - | Click Y coordinate (pixels) |
focus | boolean | ❌ | false | Whether to attempt focus before clicking |
delay | number | ❌ | false | Click to release delay |
Return Value
javascript
true // Returns true on successful operationBasic 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.