
Quick answer: To share or publish your app you build a release version: for the Play Store it is an Android App Bundle (Build → Generate Signed Bundle / APK → Android App Bundle), for direct sharing to friends an APK (same dialog, APK option). You need a signing key — Android Studio’s wizard creates one keystore file in two minutes. Debug builds (Run ▶) are for your device only; they are unsigned for distribution and slower.
Generate a signed build: the wizard path
| Step | Action | Details |
|---|---|---|
| 1 | Build → Generate Signed Bundle / APK | Choose Android App Bundle for Play, APK for direct sharing |
| 2 | Create new… keystore | Pick a folder + password. This file IS your publisher identity — back it up; losing it means you can never update the app under the same listing |
| 3 | Fill key fields | Alias (e.g. upload), your name/org, validity 25+ years (default) |
| 4 | Select release, finish | Output lands in app/release/ |
Keep the keystore file and its passwords safe and out of version control. For Play publishing, enroll in Play App Signing when prompted and keep your upload key — Google then manages the distribution signing.
Before you build: the release checklist
- App identity: change
applicationIdfromcom.example.*to your real domain-reversed id — it can never be changed after publishing. - Version: bump
versionCode(integer, every upload) andversionName(user-visible, e.g. “1.0”). - Debug leftovers: remove logging calls and test menu items; set
android:debuggableis handled automatically (release builds are non-debuggable). - Shrink: in
build.gradle.ktsrelease block:isMinifyEnabled = trueandisShrinkResources = truecut APK size dramatically. - Test the release build on a real device (our real-device guide) — minification occasionally strips something you need; check immediately.
Sharing the APK directly
The generated APK installs on any phone: send the file (Drive, chat), enable “Install unknown apps” for that source on the phone, open the file. Perfect for beta testers, classroom demos and clients without the Play Store — and the size-optimized AAB is the right artifact when you do publish to the Play Console.
For guided Android training through to your first published app, Ampersand Academy teaches Android development one-to-one.
Frequently asked questions
What is the difference between APK and AAB?
An APK installs directly on a device; an Android App Bundle is a publishing format that Google Play uses to generate optimized APKs per device. Publish AABs to the Play Store, share APKs directly with testers.
How do I generate a signed APK in Android Studio?
Build then Generate Signed Bundle or APK, choose APK, create or select your keystore, enter the passwords, pick the release variant, and finish. The APK appears in the app release folder.
What happens if I lose my keystore file?
You cannot update the app under the same Play Store listing with a new key unless you enrolled in Play App Signing, which allows a key reset through account verification. Back the keystore up securely.
Why is my release APK smaller than the debug APK?
Release builds are minified (unused code stripped), resource-shrunk, and not debuggable. Enable isMinifyEnabled and isShrinkResources in the release block for the full effect.
Can I install an APK on a phone without the Play Store?
Yes: copy the APK to the phone, allow Install unknown apps for the source (browser or file manager), then open the file. This is how beta testers and classroom demos usually work.
