extracting-test-artifacts
Installation
SKILL.md
Extracting Test Artifacts — adb pull / push and run-as
This skill covers moving files between host and device, the path permission rules that decide whether a pull succeeds, and the androidx.test:services TestStorage API for routing per-test artefacts. Capture-on-failure orchestration (when to pull what) lives in ../../automation/scripting-adb-for-ci/SKILL.md.
When to use this skill
- A test produces artefacts (screenshots, JSON, captured DBs) that need to land on CI as build outputs.
adb pull /data/data/com.example/databases/main.dbfails with "Permission denied"; the developer doesn't knowrun-asexists.- A binary file (PNG, MP4, SQLite DB) arrives on the host with mangled bytes — the missing
exec-outis the fix. - A push of a large APK or test data file is slow; the developer wants the modern compression flags (
-z brotli). - The test app writes screenshots to
/sdcard/Android/data/com.example/files/screenshots/and the developer wants to know whether that's pullable on API 30+ (it is, when the package owns it). - The team is migrating from "write to /sdcard, pull on the host" to the modern AndroidX
TestStorageAPI.