Last Updated:
Cover
Creating Debug Apk Tejas Sawant

How to build debug apk in react native ?

Tejas Sawant
Tejas Sawant how to

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 index.android.bundle

if you are on windows

notepad index.android.bundle

or if you are on linux

touch index.android.bundle

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/index.android.bundle —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).