Swipe Operation
Execute a swipe operation from starting coordinates to ending coordinates.
Interface Description
Interface Type
swipeParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
deviceId | string | ✅ | - | Device ID |
start | array | ✅ | - | Starting coordinates [x, y] |
end | array | ✅ | - | Ending coordinates [x, y] |
key | string | ❌ | 'LEFT' | Key type, 'LEFT' or 'RIGHT' |
pressTime | number | ❌ | 58 | Press delay before swipe (milliseconds) |
Return Value
javascript
true // Returns true on successful operationBasic Usage
Simple Swipe
javascript
// Simulate pull down to open notification center
await apiInvoke('swipe', {
deviceId: 'P72578581E07',
start: [screenWidth / 2, 0],
end: [screenWidh / 2, screenHeight * 0.8]
});