run_instrumented_tests
Run Gradle instrumented on-device tests on a booted device or emulator, returning per-suite timing and failing-test stack traces. Pass json=true for a structured JSON summary.
Instructions
Run Gradle instrumented (on-device) tests (default task 'connectedAndroidTest') in project_dir — requires a booted device/emulator. Returns per-suite timing and failing-test stack traces; pass json=true for a structured JSON summary instead of the text form.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Extra arguments passed to Gradle (e.g. --stacktrace, -Pflavor=free). | |
| json | No | For run_unit_tests/run_instrumented_tests: return the test summary as structured JSON (per-suite timing, full failure stack traces) instead of the human-readable text summary. Ignored by gradle_build and list_gradle_tasks. | |
| task | No | Gradle task to run. Defaults to the tool's standard task. | |
| project_dir | No | Path to the Android project root containing the Gradle wrapper (gradlew). Optional if session_set_defaults has pinned a project_dir for this session. |