When you build an Android app (native or React Native), you often need a Release APK — the file you can share with users or upload to the Play Store.
Let’s understand how this works with just two commands.
1️⃣ Move to the Android Folder
cd android
👉 Why?
Every Android/React Native project has an android folder. Inside it, you’ll find the Gradle build system files.
Gradle is the tool that actually builds your Android app.
So before we run Gradle commands, we must go inside the android directory.
2️⃣ Build the Release APK
./gradlew assembleRelease # for Mac/Linux
gradlew assembleRelease # for Windows
👉 What this does:
- Runs the Gradle build system in release mode.
- It compiles your Java/Kotlin code, bundles resources (images, layouts, etc.), and optimizes everything.
- The result is an APK file that you can install on a device or publish.
3️⃣ Where to Find the APK
After the command finishes, you’ll see this path:
android/app/build/outputs/apk/release/app-release.apk
👉 Meaning:
android/→ the Android project folderapp/→ your app modulebuild/outputs/apk/release/→ Gradle puts the generated APKs hereapp-release.apk→ your final APK file
📦 Debug vs Release APK
- Debug APK:
- Built automatically when you run the app from Android Studio or
react-native run-android. - Signed with a debug key.
- For development/testing only.
- Follow this post for debug apk : Steps to Build Offline APK for Real Device – React Native
- Built automatically when you run the app from Android Studio or
- Release APK:
- Built using
assembleRelease. - Signed with your own keystore (for Play Store upload).
- Optimized (smaller & faster).
- Built using
🎯 Purpose of These Commands
cd android→ Go inside the Android project where Gradle is located../gradlew assembleRelease→ Tell Gradle to build a release-ready APK.android/app/build/outputs/apk/release/app-release.apk→ Location of your generated APK.
With this APK:
✅ You can test the final production build on a real device.
✅ You can upload it to the Google Play Store after signing it with your keystore.
🎓 Final Takeaway
cd android→ enter Android folder./gradlew assembleRelease→ build release APKapp-release.apk→ your final app file, ready to be shared or published
👉 Think of it like baking a cake:
cd android= entering the kitchen./gradlew assembleRelease= starting the baking processapp-release.apk= the finished cake 🎂