generate debug apk react native code example

Example 1: react native debug apk

cd android && gradlew clean && cd ..
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
cd android/
gradlew assembleDebug 
(or you can use for release: gradlew assembleRelease)
cd android && gradlew clean && gradlew assembleRelease

Example 2: generate apk debug react native

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

Example 3: how to identify debug and release build in react native

if (__DEV__) {
    console.log('I am in debug');
}