extracting-test-artifacts

Extract Android test artifacts from devices to host or CI using adb run-as, exec-out, and TestStorage.

303|10|Updated May 15, 2026
One-click install
npx skills add https://github.com/skydoves/android-testing-skills --skill extracting-test-artifacts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extracting-test-artifacts
Source: https://github.com/skydoves/android-testing-skills/tree/main/adb/transfer/extracting-test-artifacts
Command: npx skills add https://github.com/skydoves/android-testing-skills --skill extracting-test-artifacts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Solving “adb pull permission denied” by correctly choosing where test artefacts are written and which extraction path to use (run-as, exec-out, or TestStorage) so CI reliably receives screenshots, logs, databases, and other files.

Core Features & Use Cases

  • Moves files device↔host correctly: Uses modern adb pull/adb push flags like compression (-z/-Z), incremental sync (--sync), and attribute preservation (-a) to speed up repeated transfers.
  • Fixes permission failures with the right strategy: Applies the path-permission rules (e.g., /data/local/tmp/, /sdcard/, /data/data/<pkg>/ via run-as, and /sdcard/Android/data/<pkg>/files/ for app-owned artefacts on API 30+).
  • Retrieves binary artefacts safely: Uses adb exec-out for binary-clean stdout (including run-as ... cat for single files and run-as ... tar | tar xf - for directory pulls from /data/data/<pkg>/).
  • Uses the modern artefact API: Routes per-test outputs through androidx.test:services TestStorage with -e useTestStorageService true so Gradle collects artefacts into connected_android_test_additional_output/ automatically.

Quick Start

Tell the AI: “I need to pull a failing test screenshot and a binary SQLite DB from my connected device—how should I use adb pull/push, run-as, and exec-out (or TestStorage) so the bytes are not corrupted and CI permissions don’t fail?”

Frequently Asked Questions about extracting-test-artifacts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix adb pull permission denied errors when extracting Android test artifacts?

To fix adb pull permission denied errors, use the correct extraction path based on file location: `run-as` for `/data/data/<pkg>/`, `/sdcard/Android/data/<pkg>/files/` for app-owned artifacts, or `/data/local/tmp/` for accessible staging.

How do I pull binary files like SQLite databases from an Android device without corruption?

To pull binary files without corruption, use `adb exec-out` with `run-as ... cat` for single files or `run-as ... tar | tar xf -` for directories, ensuring binary-clean stdout transfer from `/data/data/<pkg>/`.

What is the best way to collect Android test artifacts automatically in CI?

The best way to collect Android test artifacts automatically in CI is routing outputs through `androidx.test:services` TestStorage with `-e useTestStorageService true`, letting Gradle collect files into `connected_android_test_additional_output/` automatically.

How can I speed up repeated adb pull and push transfers during testing?

Speed up repeated adb pull and push transfers by applying modern flags like compression (`-z/-Z`), incremental sync (`--sync`), and attribute preservation (`-a`) to optimize data movement between device and host.

Does adb pull work with files stored in /data/data on Android API 30+?

adb pull does not work directly with `/data/data/<pkg>/` on non-rooted devices. You must use `run-as` with `adb exec-out` for app-private directories, or write artifacts to `/sdcard/Android/data/<pkg>/files/` on API 30+.