how to

How to build debug apk in react native ?

Creating Debug Apk Tejas Sawant

In this article i am going to tell how you can generate debug apk using bare react native application.

First you need to create app using following command

npx react-native init DebugApk

After that navigate to folder.

cd DebugApk

Check if you have android/app/src/main/assets/ if you dont have then create folder

Creating assets folder
Creating assets folder

after that create new file and save as

if you are on windows


or if you are on linux


After that run following command in command prompt.

npx 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/

Then navigate to android folder and type gradlew assembleDebug to generate apk.

cd android
gradlew assembleDebug

You will find your app in app/build/outputs/apk/debug/ folder.

Debug APK
Debug APK

You can transfer this app on any device and you can run this app without metro server(javascript server).