---
name: gradle_assemble_debug
kind: function
lang: bash
domain: infra
version: "1.0.0"
purity: impure
signature: "gradle_assemble_debug(project_dir: string, module: string) -> string"
description: "Build APK debug de un modulo Android via gradlew assembleDebug."
tags: ["android", "gradle", "build", "apk"]
params:
  - name: project_dir
    desc: "Raiz del proyecto Gradle Android"
  - name: module
    desc: "Nombre del modulo Gradle. Default: app"
output: "Stdout con build log + ultima linea 'APK: <path>'. Exit 0 = build OK. Exit !=0 si fallo."
uses_functions: ["gradle_run_bash_infra"]
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/infra/gradle_assemble_debug.sh"
---

## Ejemplo

```bash
gradle_assemble_debug /path/to/MyApp
# APK: /path/to/MyApp/app/build/outputs/apk/debug/app-debug.apk

gradle_assemble_debug /path/to/MyApp mylibrary
# APK: /path/to/MyApp/mylibrary/build/outputs/apk/debug/mylibrary-debug.apk
```

## Notas

APK queda en <project>/<module>/build/outputs/apk/debug/. Variants flavor no soportados aun (anadir arg si surge).

Depende de `gradle_run_bash_infra` (`gradle_run.sh` en el mismo directorio), que debe existir y estar indexado antes de hacer `fn index` de esta funcion.
---
