DEV Community


How to generate a debug apk in react-native

nitish173 profile image nitish ・1 min read

What is an .apk file?

An Android Package Kit (APK) is the package file format used by the Android OS for distribution and installation of mobile apps. It is similar to the .exe file you have on Windows OS, a .apk file is for android.

What can I use it for?

A debug .apk file will allow you to install and test your app before publishing to app stores. Mind you, this is not yet ready for publishing, and there are quite a few things you'll need to do to before you can publish. Nevertheless, it'll be useful for initial distribution and testing.

You'll need to enable debugging options on your phone to run this apk.


  • react-native version > 0.57

How to generate one in 3 steps?

Step 1: Go to the root of the project in the terminal and run the below command:

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

Step 2: Go to android directory:

cd android

Step 3: Now in this android folder, run this command

./gradlew assembleDebug

There! you'll find the apk file in the following path:

Now you have your .apk file generated, install it on your android phone and enjoy!

Thank you.

Discussion (11)

Editor guide
impdp profile image
Pradeep Annadurai

And if you build frequently, you can make the shortcut for bundle command in the scripts of Package.json

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

and in the terminal use:
npm run bundle-android

zanottaa profile image

worked like a charm, thank you my friend.

gautham495 profile image
Gautham Vijayan

I did what the documentation said and got aab. With this post I got an apk thank you!!!

paulhoriachiy profile image
Paul Horiachiy

Thanks, it works!

mustafasagdic profile image

Helps me a lot, thx!

joweltisso profile image
Jowel Tisso

Great Thanks... Helped me alot..

danebrown profile image
Dane Brown

Awesome stuff! Thank you very much

harishkarthick profile image

Thanks bro..

noursaloom profile image

thx a lot
but be careful guys
u should use npx before first command

ydhnwb profile image
Prieyudha Akadita S

It shows error like this:
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/ydhnwb/Workstation/Project Binar/teame-reactnative/movie_app/node_modules/acorn-globals'

nitish173 profile image
nitish Author

Sorry for late reply, I hope you've been able to figure out the problem. Apparently, this error means there's no space on the drive. Check out this if it helps: