cb6d9e61d1
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.7 KiB
1.7 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| android_screenshot | function | bash | infra | 1.0.0 | impure | android_screenshot([--serial <S>], output_path: string) -> void | Capture screen as PNG via adb exec-out screencap -p. |
|
|
false | error_go_core |
|
Stdout 'screenshot: <path> (<bytes> bytes) from <serial>'. PNG file written to disk. | false | bash/functions/infra/android_screenshot.sh |
Ejemplo
source bash/functions/infra/android_screenshot.sh
android_screenshot /tmp/screen.png
# screenshot: /tmp/screen.png (123456 bytes) from emulator-5554
# Targeting a specific device:
android_screenshot --serial emulator-5554 /tmp/screen.png
Notas
Sources adb_wsl.sh from its own directory, so ADB and ANDROID_SDK_WIN env vars
are respected as with all other android_* functions.
Exit codes:
0— screenshot captured successfully.1— missing output path, screencap produced empty file, or adb error.3— no device/emulator connected (propagated fromadb_pick_serial).
The emptiness check (! -s) handles the case where adb exec-out exits 0 but writes
zero bytes (e.g. device locked, screencap permission denied). In that case the file is
removed and exit 1 is returned.