cb6d9e61d1
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.6 KiB
2.6 KiB
name, kind, lang, domain, version, purity, signature, description, tags, params, output, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | params | output | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| android_apk_install | function | bash | infra | 1.0.0 | impure | android_apk_install([--serial S], apk_path: string, package_name?: string, activity_name?: string) -> void | Instala APK en device/emulador via adb y opcionalmente lanza la app. Multi-emulator via --serial. |
|
|
Stdout con pasos. Exit 0 = install + launch OK. Exit !=0 si install fallo o APK no encontrado. |
|
false | error_go_core | false | bash/functions/infra/android_apk_install.sh |
Ejemplo
# Solo instalar
android_apk_install /home/lucas/builds/app-debug.apk
# Instalar y lanzar con activity explícita
android_apk_install /home/lucas/builds/app-debug.apk com.fnregistry.voiceguide .MainActivity
# Instalar y lanzar sin activity (usa monkey LAUNCHER)
android_apk_install /home/lucas/builds/app-debug.apk com.fnregistry.voiceguide
# Llamada directa desde shell (no sourced)
bash bash/functions/infra/android_apk_install.sh /path/to/app.apk com.example.app .MainActivity
# Override ADB path
ADB=/custom/path/adb.exe bash bash/functions/infra/android_apk_install.sh /path/to/app.apk
Notas
- Requiere WSL2 con
adb.exeWindows accesible. El path por defecto es/mnt/c/Users/lucas/AppData/Local/Android/Sdk/platform-tools/adb.exe. Se puede sobreescribir conADB=...oANDROID_SDK_WIN=<sdk_root>antes de invocar. wslpathse usa para convertir el path WSL a formato Windows (C:\...). Si no está disponible (entorno no-WSL), se usa el path tal cual.- La instalación usa
adb install -r(reinstala si ya existe). - Si
package_namese da sinactivity_name, la app se lanza viaadb shell monkey -p <pkg> -c android.intent.category.LAUNCHER 1, que es equivalente a pulsar el icono del launcher. - El script se puede sourcear (para usar la función en otros scripts) o
ejecutar directamente. Cuando se ejecuta directamente, delega en
android_apk_install "$@".