Android Builder

June 9, 2026 Β· View on GitHub

δΈ­ζ–‡ζ–‡ζ‘£

AI-operable Android Runtime Layer. Universal build, test, install, and diagnostic driver for Android apps.

Features

  • πŸ” Auto Detection: Package name, main Activity, Gradle, ADB
  • πŸ“± Device Management: USB/WiFi auto connection
  • 🌐 Smart Wireless: Auto-detect device WiFi IP, check same LAN, get debug port
  • πŸš€ One-Click Smoke Test: build β†’ test β†’ install β†’ launch + crash detection
  • 🩺 Doctor: Environment diagnosis + crash analysis
  • πŸ“Έ Screenshot: Auto capture device screen
  • πŸ—‚οΈ UI Dump: Export UI hierarchy for AI analysis
  • πŸ“Š JSON Output: Machine-readable output for automation
  • βš™οΈ Interactive Setup: Guided first-time configuration

Quick Start

# Clone
git clone https://github.com/AnonyJcy/android-builder.git

# Enter your Android project
cd /path/to/your/android/project

# Initialize config
bash /path/to/android-builder/driver.sh init

# Run smoke test
bash /path/to/android-builder/driver.sh smoke

Commands

Basic

CommandDescription
initInitialize project config
buildBuild debug APK
testRun unit tests
installAuto build + install APK
launchLaunch app on device
logcatView app logs
cleanClean build
smokeFull smoke test with crash detection
connectCheck/connect wireless device
devicesList connected devices

Diagnostic

CommandDescription
doctorEnvironment diagnosis + crash analysis
screenshotTake device screenshot
ui-dumpExport UI hierarchy (XML)
inspectScreenshot + UI dump (for AI analysis)

Options

OptionDescription
--jsonJSON output (for: devices, doctor, smoke)

Examples

# Environment check
bash driver.sh doctor

# JSON output for automation
bash driver.sh doctor --json
bash driver.sh devices --json

# Take screenshot
bash driver.sh screenshot
bash driver.sh screenshot my_capture

# Export UI structure
bash driver.sh ui-dump

# Full inspection (screenshot + UI dump)
bash driver.sh inspect

# Enhanced smoke test
bash driver.sh smoke
bash driver.sh smoke --json

Doctor Output

[OK] Java detected: 21
[OK] ADB detected: adb
[OK] Device connected
[OK] Device WiFi IP: 192.168.1.100
[OK] No recent crashes found

JSON:

{
  "java": true,
  "adb": true,
  "gradle": true,
  "device_connected": true,
  "wifi_ip": "192.168.1.100",
  "has_crash": false
}

Smoke Test Flow

  1. Build β†’ Compile APK
  2. Test β†’ Run unit tests
  3. Check APK β†’ Verify artifact
  4. Install β†’ Install to device
  5. Launch β†’ Start app
  6. Wait β†’ Stabilize
  7. Activity Check β†’ Detect foreground
  8. Crash Check β†’ Detect runtime crashes
  9. Screenshot β†’ Auto capture

Prerequisites

License

MIT