React Native: Post 1 :- How to create debug apk file to run on android device



Create debug apk:

Step 1: Check whether the index.android.bundle file is there or not like you can check on this path android/app/src/main/assets/index.android.bundle. If not then create assets folder inside main and create a index.android.bundle file inside it.

Step 2: Run this command on root directory which create a bundle for our apk inside index.android.bundle
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/

Step 3: Run this command to generate apk file. 

cd android && ./gradlew assembleDebug 

that's it you can find your app inside android/app/build/outputs/apk/debug.

 This above code is used from stack overflow so for more details you can visit this link.

You will see your app over there but if you see that size of your apk is 40+ MB. If you want to decrease that size to 10 something then check next post How to reduce apk size

Post a Comment

Previous Post Next Post