- The apk can be downloaded on to your android device by clicking the link.
- On your device go to
system > settings > developer options >and turn on USB Debugging - https://drive.google.com/file/d/1LD4_uXwWZ2raT7AJiOA0vHhgaZqA4LrS/view?usp=drive_link
npx create-expo-app@latest my-app --template default
npx expo prebuild
Go to the RN docs and pull this up
https://reactnative.dev/docs/signed-apk-android
openssl rand -hex 32
a77c28c8****...jdk is here, cd into to run the next command (On Windows cd one more folder into the bin)
/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/HomeAfter your cd into the above folder, run the next command:
sudo keytool -genkey -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000From your jdk directory add the newly generated keystore file my-upload-key.keystore
to your android/app folder.
- In android/gradle.properties
MYAPP_UPLOAD_STORE_FILE = my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS = my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD = a77c28c8****... <---openssll pw goes here
MYAPP_UPLOAD_KEY_PASSWORD = a77c28c8****... <-----openssll pw goes here- In android/app/build.gradle
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)<——../my-upload-key.keystore
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}android/gradle.propertiesandroid/app/my-upload-key.keystore
- Then run this command —>
npx react-native build-android --mode=release - Should take about 5-10 min to build
- Find the release in
android/app/build/outputs/build/release
If you encounter a message as below, just add it to your package.json and run the build command again npx react-native build-android --mode=release
"devDependencies": {
"@react-native-community/cli": "latest",
}- Plug android device into windows/mac and run
npx expo run:android --variant release - Look for the
apkinandroid\app\build\outputs\apk\release\folder, - Typically at this point the apk is installed on the connected device after the build is successful.