42c14fae59
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.5 KiB
1.5 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, notes
| 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 | notes | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| android_shell | function | bash | infra | 1.0.0 | impure | android_shell([--serial <S>], cmd ...args) | Execute arbitrary shell command on Android device. Multi-emulator via --serial. |
|
|
Passthrough stdout/stderr de adb shell. Exit code = shell command exit. |
|
false | error_go_core | false | bash/functions/infra/android_shell.sh | Para comandos complejos con pipes/redirects mejor `adb_s $serial shell 'cmd | other'` directo via adb_run. |
Ejemplo
android_shell pm list packages
android_shell --serial emulator-5554 getprop ro.product.model
android_shell df -h /sdcard
android_shell ls -la /data/local/tmp
Notas
Sourcea adb_wsl.sh para resolver adb_pick_serial (maneja --serial, ADB_SERIAL, y auto-detect de dispositivo unico) y adb_s (wrapper de adb -s). El array ADB_PICK_REST contiene los args restantes tras consumir --serial.
Para comandos con pipes o redirects que bash interpretaria localmente, mejor pasar como string unico: adb_s "$serial" shell 'cmd | grep foo'.