1After run this in cmd
2
3react-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/
4
5cd android && ./gradlew assembleDebug
6
7then you can get apk app/build/outputs/apk/debug/app-debug.apk
1Place your terminal directory to android using:
2
3cd android
4)================
5For Windows,
6 gradlew assembleRelease
7)=================
8
9)=================
10For Linux and Mac OSX:
11
12./gradlew assembleRelease
13)==================
1Prerequisite:
2-----------------
3react-native version > 0.57
4
5How to generate one in 3 steps?
6---------------------------------
7Step 1: Go to the root of the project in the terminal and run the below command:
8---------------------------------------------------------------------------------
9react-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
10
11Step 2: Go to android directory:
12---------------------------------
13
14 cd android
15
16Step 3: Now in this android folder, run this command
17------------------------------------------------------
18 ./gradlew assembleDebug
19
20There! you'll find the apk file in the following path:
21yourProject/android/app/build/outputs/apk/debug/app-debug.apk
22
23Now you have your .apk file generated, install it on your android phone and enjoy!
24
25Thank you.