---
name: android_input_tap
kind: function
lang: bash
domain: infra
version: "1.0.0"
purity: impure
signature: "android_input_tap([--serial <S>], x: int, y: int) -> void"
description: "Send tap gesture at screen coordinates via adb shell input tap."
tags: [android, adb, input, tap, ui-test, gesture, pendiente-usar]
params:
  - name: "--serial <S>"
    desc: "Optional target device serial. Auto-detected if omitted."
  - name: "x"
    desc: "X coordinate in pixels (non-negative integer)."
  - name: "y"
    desc: "Y coordinate in pixels (non-negative integer)."
output: "Stdout 'tap @ <x>,<y> on <serial>'."
uses_functions: [adb_wsl_bash_infra]
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/infra/android_input_tap.sh"
---

## Ejemplo

```bash
# Auto-detect device
android_input_tap 540 960

# Target specific device
android_input_tap --serial emulator-5554 540 960
```

## Notas

Sources `adb_wsl.sh` para resolver el binario ADB y exponer `adb_pick_serial` / `adb_s`.
Usa `adb_pick_serial` para consumir `--serial` de los args y autodetectar el device si no se pasa.
Valida X e Y con regex `^[0-9]+$` antes de invocar adb.
Exit 3 si no hay device/emulador disponible (propagado desde `adb_pick_serial`).
