cb6d9e61d1
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 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_app_info | function | bash | infra | 1.0.0 | impure | android_app_info([--serial <S>], package, [--json]) -> stdout | Inspect installed app: version, target SDK, activities via dumpsys package. |
|
|
Raw dumpsys package output, or JSON object {package, versionName, versionCode, targetSdk, launcherActivity}. Outputs JSON null if package not installed (--json mode). Exit 2 if package not found in raw mode, exit 3 if no device. |
|
false | error_go_core | false | bash/functions/infra/android_app_info.sh |
Ejemplo
# Raw dumpsys (full output)
source bash/functions/infra/android_app_info.sh
android_app_info com.example.myapp
# Target specific device
android_app_info --serial emulator-5554 com.example.myapp
# Parsed JSON
android_app_info com.example.myapp --json
# {"package":"com.example.myapp","versionName":"2.1.0","versionCode":210,"targetSdk":34,"launcherActivity":"com.example.myapp/.MainActivity"}
# Package not installed → JSON null
android_app_info com.not.installed --json
# null
Notas
- Sources
adb_wsl.shpara resolver el binario ADB Windows desde WSL2 y las helpersadb_pick_serial/adb_s. --serialse consume viaadb_pick_serial; el resto de los args quedan enADB_PICK_RESTy se re-asignan conset --.- JSON parsing usa
grep/sed/awksobre la salida dedumpsys package. Campos faltantes se emiten como string vacío o 0; no se usajqpara no requerir dependencias externas. launcherActivityse extrae buscando el bloqueandroid.intent.action.MAIN/android.intent.category.LAUNCHERen el listado de intent filters.- Exit codes: 0 = OK, 1 = arg/adb error, 2 = package not found (raw mode), 3 = no device.