Overview
Gesture methods allow you to simulate touch interactions at specific screen coordinates. These methods use Android’sGestureDescription API to dispatch touch events.
Tap Gestures
Simulate Click
Simulate a tap at specific screen coordinates.Float
required
The X coordinate in pixels (horizontal position from left edge)
Float
required
The Y coordinate in pixels (vertical position from top edge)
The tap gesture has a 50ms duration. This simulates a quick tap that most apps will recognize as a click event.
Swipe Gestures
Simulate Swipe
Simulate a swipe gesture from one point to another.Float
required
The starting X coordinate in pixels
Float
required
The starting Y coordinate in pixels
Float
required
The ending X coordinate in pixels
Float
required
The ending Y coordinate in pixels
The swipe gesture has a 500ms duration, creating a smooth scrolling motion that mimics natural user interaction.
Scroll Gestures
Scroll to Bottom
Simulate a vertical swipe to scroll down the page.This method performs a swipe from Y=1200 to Y=300 at X=300, creating a downward scroll motion. The gesture duration is 700ms.
Scroll to Bottom (Custom X)
Scroll down at a specific horizontal position.Int
required
The X coordinate where the scroll should occur
Useful for scrolling specific panels or sections of the screen in multi-column layouts.
Scroll to Top
Simulate a vertical swipe to scroll up the page.This method performs a swipe from Y=1100 to Y=1400 at X=550, creating an upward scroll motion. The gesture duration is 700ms.
Coordinate System
Understanding the Android screen coordinate system:- Origin (0, 0): Top-left corner of the screen
- X-axis: Increases from left to right
- Y-axis: Increases from top to bottom
- Dimensions: Vary by device (e.g., 1080×1920 for Full HD phones)
Getting Screen Dimensions
To make your gestures device-independent:Advanced Gesture Techniques
Getting Node Bounds
Combine node finding with gesture tapping:Multi-Step Gestures
Create complex interactions with sequential gestures:Pinch and Zoom
Example concept (not implemented in current API):Timing and Delays
Proper timing is crucial for reliable automation:Recommended Delays
- After click: 300-500ms
- After page navigation: 1000-2000ms
- After scroll: 500-1000ms
- After text input: 200-500ms
- Between rapid taps: 50-100ms
Gesture Fallback Patterns
The service uses a three-tier approach for clicking:- Semantic click: Try
node.performAction(ACTION_CLICK) - Parent click: Bubble up to find clickable parent
- Gesture click: Tap at center coordinates as fallback
Error Handling
Gesture methods handle errors gracefully:Best Practices
Prefer element-based clicking (by view ID, content description) over coordinate-based tapping when possible
Use relative coordinates (percentages of screen size) instead of absolute pixels for device independence
Add appropriate delays after gestures to allow animations and UI updates to complete
Test gestures on multiple screen sizes and densities
Common Patterns
Infinite Scroll Loading
Pull to Refresh
Horizontal Carousel Navigation
Dismiss Bottom Sheet
Debugging Gestures
Enable touch visualization to debug gesture coordinates:API Reference
Next Steps
Node Operations
Learn element-based interaction methods
Overview
Return to Accessibility Service overview