This command builds the signed APK ready for release.
React Native
./gradlew assembleRelease
Sample App
This script shows the main steps to create a signing key and build a signed APK for your React Native Android app.
React Native
# This is a shell script example to build and sign React Native Android app# Step 1: Generate keystore (run once)
keytool -genkeypair -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000# Step 2: Create or edit android/gradle.properties with:# MYAPP_UPLOAD_STORE_FILE=my-release-key.keystore# MYAPP_UPLOAD_KEY_ALIAS=my-key-alias# MYAPP_UPLOAD_STORE_PASSWORD=your-store-password# MYAPP_UPLOAD_KEY_PASSWORD=your-key-password# Step 3: Build signed APK
cd android
./gradlew assembleRelease
# The signed APK will be at android/app/build/outputs/apk/release/app-release.apk
OutputSuccess
Important Notes
Always back up your keystore file and passwords. Losing them means you cannot update your app.
Use strong passwords to protect your keystore.
Test your signed APK on a device before publishing.
Summary
Building and signing prepares your app for safe release.
Generate a keystore, configure Gradle, then build the signed APK.
Keep your signing keys and passwords secure to update your app later.
Practice
(1/5)
1. What is the main purpose of signing an Android app in React Native?
easy
A. To make the app run faster on Android devices
B. To reduce the app's file size before publishing
C. To verify the app's author and ensure it hasn't been tampered with
D. To enable debugging features in the app
Solution
Step 1: Understand app signing purpose
Signing an app proves who created it and ensures it is secure and unchanged.
Step 2: Compare options
Only To verify the app's author and ensure it hasn't been tampered with describes verifying author and app integrity, which is the purpose of signing.
Final Answer:
To verify the app's author and ensure it hasn't been tampered with -> Option C
Quick Check:
App signing = Verify author and integrity [OK]
Hint: Signing proves app identity and security [OK]
Common Mistakes:
Thinking signing makes app faster
Confusing signing with debugging
Believing signing reduces app size
2. Which command is used to generate a new keystore for signing an Android app?