Google Play publishing
Hub › Android › Advanced › Google Play publishing
Goal
Generate a signed app bundle, upload to Google Play Console, manage internal/closed/open testing tracks, and publish to production.
Prerequisites
- Firebase Crashlytics
- A Google Play Console account ($25 one-time fee)
Build types
Ensure your build.gradle.kts has a release build type:
android {
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}"Minify enabled" shrinks, obfuscates, and optimizes the code. "Shrink resources" removes unused resources.
App signing
Two approaches:
Play App Signing (recommended): Google manages the signing key. You upload an upload key, Google signs the final APK/AAB with your app signing key.
- Generate an upload key:
keytool -genkey -v -keystore upload-keystore.jks \
-alias upload-key -keyalg RSA -keysize 2048 \
-validity 10000- Configure in
build.gradle.kts:
android {
signingConfigs {
create("release") {
storeFile = file("upload-keystore.jks")
storePassword = System.getenv("STORE_PASSWORD")
keyAlias = "upload-key"
keyPassword = System.getenv("KEY_PASSWORD")
}
}
buildTypes {
release {
signingConfig = signingConfigs["release"]
}
}
}Generate the bundle
./gradlew bundleRelease
# Output: app/build/outputs/bundle/release/app-release.aabUpload to Google Play Console
- Go to Google Play Console
- Create a new app (or select existing)
- Go to Testing → Internal testing
- Click Create new release
- Upload the
.aabfile - Fill in the release notes
- Save → Review → Start rollout to Internal testing
Testing tracks
| Track | Description |
|---|---|
| Internal | Up to 100 testers, no review required. Fastest feedback loop |
| Closed (alpha) | Invite-only, configurable tester list. Useful for friends and QA |
| Open (beta) | Public link, anyone can join. Good for wider testing |
| Production | Available to all users on Google Play |
CI/CD publishing
For automated uploads, use Gradle Play Publisher or bundletool:
# Using bundletool to generate APKs from AAB:
java -jar bundletool.jar build-apks \
--bundle=app-release.aab \
--output=app.apks \
--ks=upload-keystore.jks \
--ks-key-alias=upload-key
# Install directly on device:
java -jar bundletool.jar install-apks --apks=app.apksProduction checklist
- [ ] Crashlytics verified with a test crash
- [ ] Performance traces showing startup time < 2s
- [ ] ProGuard/R8 rules correct (no missing class crashes)
- [ ] Store listing completed (description, screenshots, category)
- [ ] Content rating questionnaire filled
- [ ] Privacy policy URL added (required if collecting any user data)
Checkpoint
./gradlew bundleRelease
# BUILD SUCCESSFUL in 45s
# app-release.aab ready at app/build/outputs/bundle/release/
# Upload to Play Console → Internal testing → install on test deviceYou've completed the Android Advanced tier. The intermediate ViewModel/StateFlow app is now a production-quality Android app with Room persistence, Hilt DI, Firebase Auth, DataStore, WorkManager, unit/UI tests, Crashlytics performance monitoring, and Google Play publishing.