Android input injection
Drive the touchscreen and key stack directly: coordinates and events rather than semantic UI targets.
When to use
- Tapping/flinging when the UI tree is unreliable or an app blocks it.
- Typing characters or key chords (back, home, recents, volume, d-pad).
- Scrolling a list, swiping a view, long-pressing a tile.
Tools used
tap— tap at (x, y);long_press— press-and-hold a point.swipe— drag from start to end (with duration).scroll— directional scroll with a step count.type— inject text into the focused field.key— send a named key event;back,home,recents— nav shortcuts.screen_info— current resolution/orientation before any coordinate math.
Procedure
screen_info— refresh resolution, density, orientation.- Map intent to coordinates/gestures (honour safe margins and keyboard insets).
- Confirm the action sequence with the human (gestures are mutative).
- Inject the smallest sequence that achieves the effect.
ui_read/screenshot after to confirm the resulting screen state (evidence).
Security
- Coordinate input is fragile and can hit anything: require approval, prefer
android-uisemantic targeting when available. - Never inject into credential fields; hand keyboard control to the human.
- Stop at the first sign the device no longer matches
screen_info.
Related skills
android-ui · android-screen · android-device-info · android-control