Skip to content
Back to skills

Android Apk Cli Build

ASecurity

Build Android APK from CLI on Windows without Android Studio

  • 2 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 10, 2026
ai-agentsgojavabashgit

Works with

  • cli

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill android-apk-cli-build --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Android Apk Cli Build?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Android Apk Cli Build
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-android-apk-cli-build/badge)](https://www.skillsdirectory.com/skills/loopyluci-android-apk-cli-build)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: android-apk-cli-build
description: "Build Android APK from CLI on Windows without Android Studio"
---

# Android APK CLI Build on Windows

Build a debug APK without Android Studio using portable JDK + SDK tools.

## Quick Start

```bash
# 1. JDK (portable)
curl -L -o "C:\Users\%USERNAME%\Downloads\jdk17.zip" \
  "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.14%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.14_7.zip"
unzip -q /c/Users/YourName/Downloads/jdk17.zip -d /c/Users/YourName/Downloads/jdk_extract
export JAVA_HOME="C:\\Users\\YourName\\Downloads\\jdk_extract\\jdk-17.0.14+7"
export PATH="$JAVA_HOME/bin:$PATH"

# 2. Android cmdline-tools
curl -L -o "C:\Users\%USERNAME%\Downloads\cmdline-tools.zip" \
  "https://dl.google.com/android/repository/commandlinetools-win-11076708_latest.zip"
unzip -q /c/Users/YourName/Downloads/cmdline-tools.zip -d /c/Users/YourName/Downloads/cmd_extract
mkdir -p /c/Users/YourName/Android/Sdk/cmdline-tools
mv /c/Users/YourName/Downloads/cmd_extract/cmdline-tools /c/Users/YourName/Android/Sdk/cmdline-tools/latest

# 3. Install SDK
export ANDROID_SDK_ROOT="C:\\Users\\YourName\\Android\\Sdk"
export PATH="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$PATH"
yes | sdkmanager --sdk_root="$ANDROID_SDK_ROOT" "platforms;android-34" "build-tools;34.0.0"

# 4. Generate wrapper
curl -L -o gradle-8.2-bin.zip "https://services.gradle.org/distributions/gradle-8.2-bin.zip"
unzip -q gradle-8.2-bin.zip
export PATH="/c/Users/YourName/Downloads/gradle-8.2/bin:$PATH"
cd /path/to/android && gradle wrapper --gradle-version=8.2

# 5. Build
echo "sdk.dir=C:/Users/YourName/Android/Sdk" > local.properties
export JAVA_HOME="C:\\Users\\YourName\\Downloads\\jdk_extract\\jdk-17.0.14+7"
export ANDROID_SDK_ROOT="C:\\Users\\YourName\\Android\\Sdk"
./gradlew assembleDebug --no-daemon
```

APK output: `app/build/outputs/apk/debug/app-debug.apk`

## Path Rules

| Variable | Format | Example |
|----------|--------|---------|
| JAVA_HOME | Windows `\\` | `C:\\Users\\Name\\jdk` |
| ANDROID_SDK_ROOT | Windows `\\` | `C:\\Users\\Name\\Android\\Sdk` |
| local.properties | Forward `/` | `sdk.dir=C:/Users/Name/Android/Sdk` |
| curl -o | Windows `\` quoted | `"C:\Users\Name\file.zip"` |

## Common Errors

| Error | Fix |
|-------|-----|
| `sdkmanager not found` | cmdline-tools/latest/bin in PATH |
| `JAVA_HOME invalid` | Use Windows-style path with double backslashes |
| `ic_launcher not found` | Create PNG icons with PIL or XML drawables |
| `Unresolved reference` | Use fully-qualified names: `android.content.Intent` |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.