x2y Android Runtime
IDE-free Android automation with command-line and programmatic control
Overview
x2y-Android-Runtime is a powerful, self-contained Android automation runtime meticulously crafted for developers who prioritize precision, efficiency, and programmatic control over the complexities and overhead of traditional IDEs. Say goodbye to needing Android Studio for every build, test, or deployment task.
This runtime liberates your development workflow, enabling you to generate, build, sign, and manage Android applications entirely from the Command Line Interface (CLI) or through JavaScript APIs. It provides a direct, unencumbered pathway to the real Android toolchain, putting full control at your fingertips.
Why Choose x2y-Android-Runtime?
IDE-Free Development
Perform Android development tasks without Android Studio, perfect for lightweight scripting
Full Programmatic Access
Control every stage with robust CLI commands or JavaScript APIs
Official Toolchain Reliability
Directly leverages official Android tools (adb, gradlew, keytool)
Streamlined Automation
Designed for CI/CD pipelines and custom build systems
Core Capabilities
- →Project Generation: Swiftly scaffold complete Android application projects
- →Robust Building: Compile and assemble installable APKs using official Gradle Wrapper
- →Secure Signing: Sign APKs using production keystores or auto-generate debug keystores
- →Build Optimization: Enhance app performance with integrated zipalign optimization
- →Device Management: Interact with connected Android devices and emulators via ADB
- →End-to-End Automation: Automate entire app build and deployment cycle
Requirements
Ensure you have the following installed:
• Node.js v18+
• JDK 17 (Temurin)
• Android SDK with build-tools
• keytool and adb in PATH
Installation
NPM Global
npm install -g x2y-android-runtimeNPM (Project)
npm install x2y-android-runtimeGitHub (Source)
git clone https://github.com/x2yDevs/x2y-android-runtime.git
cd x2y-android-runtime
npm installCLI Usage
List Connected Devices
x2y-android devices
# Output:
# Connected devices:
# emulator-5554 (device)
# ABC123DEF456 (offline)Build a Real APK
x2y-android build \
-p ./my-app \
-n "My Awesome App" \
-k ./my-release.keystore \
-K "keystore_password" \
-a "my-key-alias" \
-A "key_password"
# If no keystore provided, debug keystore is auto-generated
# On success:
# Build successful.
# APK: C:\path\to\my-app\app\build\outputs\apk\debug\app-debug.apkJavaScript Usage
Integrate x2y-android-runtime into Node.js scripts for custom automation:
const { build } = require('x2y-android-runtime');
(async () => {
try {
const apkPath = await build.buildAndroidApp({
projectPath: './my-app',
appName: 'MyApp',
keystorePath: './debug.keystore',
keystorePassword: 'android',
keyAlias: 'androiddebugkey',
keyPassword: 'android'
});
console.log('APK ready:', apkPath);
} catch (err) {
console.error('Build failed:', err.message);
}
})();Technologies Used
- •Node.js: Primary runtime environment
- •Java Development Kit (JDK): For compiling Java code
- •Android SDK: Core Android development tools
- •Gradle: Build automation system
- •Official Tools: gradlew, keytool, apksigner, zipalign