---
name: android_app_kill
kind: function
lang: bash
domain: infra
version: "1.0.0"
purity: impure
signature: "android_app_kill([--serial <S>], package: string) -> void"
description: "Force-stop running app via am force-stop. Multi-emulator via --serial."
tags: [android, adb, app, kill, force-stop, pendiente-usar]
params:
  - name: "--serial <S>"
    desc: "Optional target device/emulator serial. Auto-detected if omitted."
  - name: "package"
    desc: "App package to force-stop (e.g. com.example.myapp)."
output: "Stdout 'killed <pkg> on <serial>'. Exit 0."
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_app_kill.sh"
---

## Ejemplo

```bash
# Detener app en el emulador activo
android_app_kill com.example.myapp

# Detener app en un dispositivo concreto
android_app_kill --serial emulator-5554 com.example.myapp
```

## Notas

Usa `adb_pick_serial` de `adb_wsl.sh` para resolver el dispositivo objetivo.
Si `--serial` no se pasa, autodetecta el primer device/emulador disponible.
Sale con exit 3 si no hay ningun device conectado.
`am force-stop` detiene todos los procesos y servicios de la app de forma inmediata.
