jetstart build
Build production-ready Android APK files with optional release optimization and signing. This command handles the entire build process from Kotlin compilation to final APK packaging.
Usage
jetstart build [options]
Quick Start
# Debug build (unsigned, debuggable)
jetstart build
# Release build (optimized, unsigned)
jetstart build --release
# Release build with signing
jetstart build --release --sign
# Custom output directory
jetstart build --output ./dist
Options
| Option | Type | Default | Description |
|---|---|---|---|
-o, --output <path> | string | ./build | Output directory for APK files |
-r, --release | boolean | false | Build release variant (optimized) |
--sign | boolean | false | Sign the APK (requires keystore) |
--self-sign | boolean | false | Auto-generate a test keystore and sign (not for Play Store) |
--bundle | boolean | false | Build AAB (Android App Bundle) instead of APK |
--flavor <n> | string | - | Build a specific product flavor |
Build Types
Debug Build (Default)
Debug builds are optimized for development and testing:
jetstart build
Characteristics:
- Debuggable: Can attach debugger
- Unsigned: Uses debug certificate
- No obfuscation: Code is readable
- Larger size: ~30-40% larger than release
- Faster build: No ProGuard/R8 optimization
Use cases:
- Local testing
- Internal QA
- Development debugging
- Emulator testing
Output:
build/outputs/apk/debug/app-debug.apk
Release Build
Release builds are optimized for production distribution:
jetstart build --release
Characteristics:
- Not debuggable: Debugging disabled
- Unsigned (unless
--signflag used) - Obfuscated: ProGuard/R8 minification
- Smaller size: 30-40% smaller than debug
- Slower build: Optimization takes time
Use cases:
- Play Store submission (with signing)
- Production deployment
- Public distribution
- Performance testing
Output:
build/outputs/apk/release/app-release-unsigned.apk
Build Process
Step-by-Step Flow
1. Project Validation
├─ Check for build.gradle
├─ Verify Android SDK installation
└─ Validate package name and version
2. Dependency Resolution
├─ Download required libraries
├─ Resolve version conflicts
└─ Cache dependencies
3. Kotlin Compilation
├─ Compile *.kt source files
├─ Generate Java bytecode
└─ Process annotations
4. Resource Processing
├─ Compile XML layouts
├─ Process strings and drawables
├─ Generate R.java resource file
└─ Merge manifests
5. DEX Conversion
├─ Convert Java bytecode to Dalvik
├─ Merge multiple DEX files
└─ Optimize DEX bytecode
6. APK Packaging
├─ Combine DEX, resources, assets
├─ Compress into ZIP archive
└─ Align bytecode (zipalign)
7. Signing (if --sign flag)
├─ Load keystore
├─ Sign APK with certificate
└─ Verify signature
8. Output
└─ Save APK to output directory
Build Timeline
Debug Build:
Validation: 0.5s ████
Dependencies: 2.0s ████████████████
Compilation: 8.0s ████████████████████████████████
Resources: 3.0s ████████████
DEX: 4.0s ████████████████
Packaging: 1.5s ██████
────────────────────────────────────────
Total: ~19s
Release Build (with R8):
Validation: 0.5s ██
Dependencies: 2.0s ████████
Compilation: 10.0s ████████████████████████
Resources: 3.5s ██████████
R8 Optimization: 12.0s ████████████████████████████████
DEX: 5.0s ████████████
Packaging: 2.0s ████████
Signing: 1.0s ████
────────────────────────────────────────
Total: ~36s