Create a local unsigned apk

REQUIRED VERSION > 0.58

If you’re in the early stages of developing a react native app or just want a quick and easy way to share an apk with your QA or a client who has an android phone, you can easily generate a debug apk file which is unsigned. This requires the chosen android phone to have developer mode enabled and allow the installation of unsigned apps. Most of you will know about this but for further info visit the link in additional reading to enable this.

Ensure you build your local .env file for whichever enviornment you wish the outputted app to point at, such as staging. Your project may vary so refer to your scripts in the projects package.json.

Run the following

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

Once Metro has done its thing and you see “Done copying assets”, change directory into android

cd android

and run the below command

./gradlew assembleDebug

Once this is complete and you see “BUILD SUCCESSFUL” in your terminal, you’ll find your apk file ready to go in “yourProject/android/app/build/outputs/apk/debug/”

Mark Hickson

Developer, React > Ember