Main Site ↗

android-deploy-usb

by asnar0010GitHub

Builds and deploys Android apps to USB-connected devices using Gradle and ADB. Provides fast incremental builds (2-5 seconds) and handles common debugging issues like device authorization and Java environment setup. Includes troubleshooting steps for connection problems.

Unlock Deep Analysis

Use AI to visualize the workflow and generate a realistic output preview for this skill.

Powered by Fastest LLM

Target Audience

Android developers testing apps on physical devices during development, particularly those using USB debugging workflows.

8/10Security

Low security risk, safe to use

9
Clarity
9
Practicality
8
Quality
7
Maintainability
6
Innovation
Mobile
androidadbgradleusb-debuggingapp-deployment
Compatible Agents
Claude Code
Claude Code
~/.claude/skills/
Codex CLI
Codex CLI
~/.codex/skills/
Gemini CLI
Gemini CLI
~/.gemini/skills/
O
OpenCode
~/.opencode/skills/
O
OpenClaw
~/.openclaw/skills/
GitHub Copilot
GitHub Copilot
~/.copilot/skills/
Cursor
Cursor
~/.cursor/skills/
W
Windsurf
~/.codeium/windsurf/skills/
C
Cline
~/.cline/skills/
R
Roo Code
~/.roo/skills/
K
Kiro
~/.kiro/skills/
J
Junie
~/.junie/skills/
A
Augment Code
~/.augment/skills/
W
Warp
~/.warp/skills/
G
Goose
~/.config/goose/skills/
SKILL.md

Android USB Deploy

Overview

Builds an Android app using Gradle and installs it directly to a USB-connected Android device via ADB (Android Debug Bridge). This is the fastest way to test on real hardware during development.

When to Use

Invoke this skill when the user:

  • Asks to "deploy to Android"
  • Wants to "install the app on device"
  • Says "build and deploy Android"
  • Mentions testing on physical Android device
  • Wants to "push to device"

Prerequisites

  • Android device connected via USB
  • USB Debugging enabled (Settings → System → Developer options → USB debugging)
  • Developer Mode enabled (Settings → About Phone → tap Build number 7 times)
  • ADB installed (brew install android-platform-tools on macOS)
  • Device authorized for debugging (RSA key accepted)
  • JAVA_HOME must be set: export JAVA_HOME="/opt/homebrew/opt/openjdk"

Instructions

  1. Navigate to the Android app directory (look for build.gradle.kts):

    cd path/to/android/app
    
  2. Set JAVA_HOME environment variable:

    export JAVA_HOME="/opt/homebrew/opt/openjdk"
    
  3. Run the install-device.sh script:

    ./install-device.sh
    
  4. The script will:

    • Check if device is connected via adb devices
    • Build the APK with ./gradlew assembleDebug
    • Install with adb install -r app/build/outputs/apk/debug/app-debug.apk
    • Launch the app with adb shell am start
  5. Inform the user:

    • Initial build may take longer (~10-30 seconds)
    • Subsequent builds are faster (~2-5 seconds)
    • App will launch automatically on device
    • Check device screen to see the app running

Expected Output

📱 Installing NoobTest to connected device...
✅ Found device: ABC123XYZ
🔨 Building...
✅ Build complete
📲 Installing...
✅ Installation complete
🚀 Launching app...
🎉 App installed and launched!

How It Works

The deployment process:

  1. Check device: adb devices confirms connection
  2. Build APK: ./gradlew assembleDebug compiles the app
  3. Install: adb install -r (replace existing installation)
  4. Launch: adb shell am start -n com.miso.noobtest/.MainActivity

Common Issues

"no devices found":

  • Enable USB debugging in Developer Options
  • Accept RSA authorization prompt on device
  • Try: adb kill-server && adb start-server
  • Check USB cable supports data (not just charging)

"Unable to locate a Java Runtime":

  • Set JAVA_HOME: export JAVA_HOME="/opt/homebrew/opt/openjdk"
  • Verify: echo $JAVA_HOME
  • Install OpenJDK if missing: brew install openjdk

"INSTALL_FAILED_UPDATE_INCOMPATIBLE":

  • App signatures don't match existing installation
  • Uninstall first: adb uninstall com.miso.noobtest
  • Try installation again

"device unauthorized":

  • Check device screen for RSA key authorization prompt
  • Accept the authorization
  • Replug device and try again

"adb: command not found":

  • Install Android platform tools: brew install android-platform-tools

Build Speed

  • First build: ~10-30 seconds (downloads dependencies)
  • Incremental builds: ~2-5 seconds
  • Much faster than iOS due to Gradle's incremental compilation

Package Name

The script is configured for the specific app's package name (e.g., com.miso.noobtest for Firefly/NoobTest). Different apps have different package names configured in build.gradle.kts.

Gradle Note

Always set JAVA_HOME before running Gradle commands. This is a critical requirement on macOS with Homebrew-installed Java.

Source: https://github.com/asnar00/miso#.claude~skills~android-deploy-usb

Content curated from original sources, copyright belongs to authors

Grade A
8.0AI Score
Best Practices
Checking...
Try this Skill

User Rating

USER RATING

0UP
0DOWN
Loading files...

WORKS WITH

Claude Code
Claude
Codex CLI
Codex
Gemini CLI
Gemini
O
OpenCode
O
OpenClaw
GitHub Copilot
Copilot
Cursor
Cursor
W
Windsurf
C
Cline
R
Roo
K
Kiro
J
Junie
A
Augment
W
Warp
G
Goose