Android (Native)
Distribute Native Android (Kotlin/Java) APK builds effortlessly using the BuildShare CLI.
For native Android applications built using Kotlin or Java, the Gradle build system packages compiled applications into either APKs or AAB (Android App Bundle) formats.
Typical Build Paths
Depending on your Gradle build type and flavor options, output paths are typically:
- Android APK (Release):
./app/build/outputs/apk/release/app-release.apk - Android APK (Debug):
./app/build/outputs/apk/debug/app-debug.apk - Android AAB (Release):
./app/build/outputs/bundle/release/app-release.aab
Uploading Your Build
Once you have initialized your project with buildshare init (which auto-detects your Android build directory), compile your release APK and upload using the platform command:
# 1. Build the release APK
./gradlew assembleRelease
# 2. Upload using platform auto-discovery
buildshare upload android --notes "Sprint release build"If you prefer uploading directly by file path, supply your project ID:
buildshare upload ./app/build/outputs/apk/release/app-release.apk --app <projectId> --notes "Release build"Fast CI/CD Automation
Run the build and upload non-interactively in your pipeline with exit code tracking:
./gradlew assembleRelease && buildshare upload android --ci --jsonGradle Integration Example
You can add a custom Gradle task to your app/build.gradle to invoke BuildShare CLI automatically whenever a release build completes:
tasks.register('distributeToBuildShare', Exec) {
dependsOn 'assembleRelease'
workingDir project.rootDir
commandLine 'buildshare', 'upload', './app/build/outputs/apk/release/app-release.apk', '--ci', '--notes', 'Auto-distributed from Gradle'
}Now, simply run:
./gradlew distributeToBuildShareGitHub Actions CI/CD
To automate your native Android builds and uploads on GitHub Actions, see the GitHub Actions Guide.