Skip to main content

Swipe Mobile Screen

Command description

Swipe from one point to another on the mobile screen. The upper-left corner is (0, 0), and the lower-right corner is (screen width, screen height).

Command Input Parameters

input parametersInput parameter typeDescription
Mobile Device ObjectPhoneConnected mobile object
Start X Coordinateint or strStarting X coordinate
Start Y Coordinateint or strStarting Y coordinate
End X Coordinateint or strEnding X coordinate
End Y Coordinateint or strEnding Y coordinate
Swipe DurationnumberTime to swipe from the starting point to the ending point, in seconds

Command Output Parameters

None

Type definition reference

Coordinates and duration description

  • All coordinates are based on the upper left corner of the phone screen as the origin
  • If you have obtained the element object, you can directly use phoneElement.x_center and phoneElement.y_center as the starting point or end point
  • A longer Swipe Duration produces a slower swipe. Use a shorter duration when the page needs inertial scrolling.

Example

Swipe to load more contacts

tip

Enable Developer options on the mobile device, then connect it to the computer with a USB cable. See Connect Mobile Device

FAQ

See Mobile Automation FAQ