Skip to main content

swipe

Function swipe 

Source
pub async fn swipe(
    host: &Host,
    device_id: &str,
    from: (u32, u32),
    to: (u32, u32),
    duration_ms: Option<u32>,
) -> Result<()>
Expand description

Perform a swipe gesture on an Android device.

Uses adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms] to simulate a swipe.

§Arguments

  • device_id - The Android device identifier
  • from - Starting coordinates (x, y)
  • to - Ending coordinates (x, y)
  • duration_ms - Optional duration in milliseconds (default ~300ms if not specified)

§Errors

Returns an error if the swipe command fails or the device is not available.