list_gradle_variants
Lists buildable Android Gradle variants (e.g., debug, release) from a project directory. Use this to identify the exact variant name for building or installing a specific flavor or build type.
Instructions
List the buildable build variants in project_dir (parsed from the assemble* tasks) — the Android analogue of "list schemes". Each variant V maps to an assembleV / installV Gradle task; pass it as the task= arg to gradle_build/build_and_run to disambiguate a multi-flavor project. Test-only APK tasks (androidTest/unitTest) are excluded. In a multi-module build the ROOT project usually has no variants of its own (no Android plugin applied there) — pass task=":tasks" (e.g. ":app:tasks", from list_gradle_projects) to scope to the module that actually builds APKs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | Gradle task to scope to, e.g. ":app:tasks" to list variants for the :app module. Defaults to the root project's tasks. | |
| 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. |