Step-by-Step Tutorial: Publishing a React Native App to Google Play Store
Step 1: Create a Google Play Console Account
- Go to google.com and search for “Google Play Console.”
- Click on “Go to Play Console.”
- Log in to your Google account.
- Choose “Create for yourself.”
- Provide your developer name, contact information, and address.
- Agree to the terms and conditions.
- Pay the $25 developer registration fee.
Step 2: Generate an Upload Key Keystore
- Open a terminal window.
- Navigate to the JDK bin folder.
- Run the following command and Enter a password for the keystore and provide answers to the prompts.
Windows
On Windows keytool
must be run from C:\Program Files\Java\jdkx.x.x_x\bin
, as administrator.
keytool -genkeypair -v -storetype PKCS12 -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
This command prompts you for passwords for the keystore and key and for the Distinguished Name fields for your key. It then generates the keystore as a file called my-upload-key.keystore
.
The keystore contains a single key, valid for 10000 days. The alias is a name that you will use later when signing your app, so remember to take note of the alias.
macOS
On macOS, if you’re not sure where your JDK bin folder is, then perform the following command to find it:
/usr/libexec/java_home
It will output the directory of the JDK, which will look something like this:
/Library/Java/JavaVirtualMachines/jdkX.X.X_XXX.jdk/Contents/Home
Navigate to that directory by using the command cd /your/jdk/path
and use the keytool command with sudo permission as shown below.
sudo keytool -genkey -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
CAUTION
Remember to keep the keystore file private. In case you’ve lost upload key or it’s been compromised you should follow these instructions.
Step 3: Add Keystore to Android Project
- Drag the keystore file into the
android/app
folder. - Open
android/app/build.gradle
and add the following lines:
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
Step 4: Change App Name and Package Name (Optional)
- Install
react-native-rename
globally:yarn global add react-native-rename
- Run
npx react-native rename
and provide the new name and package identifier.
Step 5: Update Version Numbers (Optional)
- Install
react-native-version
globally:yarn global add react-native-version
- Run
react-native version
and provide the new version numbers.
Step 6: Generate Android Icons
- Go to appicon.co and generate icons for Android.
- Drag the generated icons into
android/app/src/main/res
.
Step 7: Create Android App Bundle
- Navigate to
android/app
in the terminal. - Run
./gradlew bundleRelease
.
Step 8: Create App in Google Play Console
- Go to the Google Play Console dashboard.
- Click “Create App.”
- Provide app name, language, and other details.
Step 9: Configure App Settings
- Go to “Setup App” and complete the following steps:
- App access
- Ads
- Content rating
- Target audience
- Data safety
Step 10: Manage App Listing
- Go to “Manage App Listing.”
- Provide app category, description, screenshots, and other details.
Step 11: Release App
- Go to “Releases” and click “Create New Release.”
- Provide a release name and notes.
- Upload the Android App Bundle.
- Review the release and click “Start rollout to production.”
Step 12: Update App (Optional)
- Increment the version numbers in
package.json
andandroid/app/build.gradle
. - Build a new Android App Bundle.
- Create a new release in the Google Play Console and upload the new bundle.