android-cli

📁 redth/androidsdk.tools 📅 Today
1
总安装量
1
周安装量
#76178
全站排名
安装命令
npx skills add https://github.com/redth/androidsdk.tools --skill android-cli

Agent 安装分布

amp 1
cline 1
opencode 1
cursor 1
kimi-cli 1
codex 1

Skill 文档

AndroidSdk.Tool CLI Reference

The android CLI is a .NET global tool providing programmatic access to Android SDK management. Install with:

dotnet tool install -g AndroidSdk.Tool

Command Groups

Group Purpose
sdk SDK package management (list, install, download, licenses)
avd Android Virtual Device management (create, delete, start)
device Connected device operations via ADB
jdk JDK discovery and configuration
apk APK inspection tools

Quick Start Examples

# Find SDK and show info
android sdk find
android sdk info

# List available and installed packages
android sdk list --available
android sdk list --installed

# Install emulator and system image
android sdk install --package emulator
android sdk install --package "system-images;android-34;google_apis;x86_64"

# Create and start an emulator
android avd create --name TestDevice --sdk "system-images;android-34;google_apis;x86_64" --device pixel_6
android avd start --name TestDevice --wait-boot

# List connected devices and install APK
android device list
android device install --package ./app.apk

Common Options

Most commands support:

  • -f|--format <json|xml> – Output as JSON or XML instead of table
  • -h|--home <path> – Specify Android SDK home path (overrides auto-detection)

Detailed Command Reference

For complete parameter details, see:

CI/CD Workflow Example

# Download SDK to specific location (for CI)
android sdk download --home /opt/android-sdk --force

# Accept all licenses non-interactively
android sdk accept-licenses --force

# Install required components
android sdk install --package "platform-tools"
android sdk install --package "emulator"
android sdk install --package "platforms;android-34"
android sdk install --package "system-images;android-34;google_apis;x86_64"

# Create headless emulator
android avd create --name CI_Emulator --sdk "system-images;android-34;google_apis;x86_64" --device pixel_6 --force

# Start emulator in headless mode and wait for boot
android avd start --name CI_Emulator --no-window --no-audio --no-boot-anim --wait-boot --timeout 300

# Run tests, then devices are cleaned up when CI job ends

Setting .NET MAUI/Xamarin Preferred Paths

Configure the SDK/JDK paths that .NET Android workloads will use:

# Set preferred Android SDK for .NET builds
android sdk dotnet-prefer --home /path/to/android-sdk

# Set preferred JDK for .NET builds
android jdk dotnet-prefer --home /path/to/jdk