I have multiple build variants in my RN project and debug in physical device
productFlavors{
gms{
applicationIdSuffix ".gms"
}
hms{
applicationIdSuffix ".hms"
}
}
buildTypes{
debug{ ... }
staging{...}
release{...}
}
When I run react-native run-android --variant=hmsdebug --appIdSuffix=hms, I'm able access into RN debugging mode with auto bundled js code and start hot reloading.
However, if I run react-native run-android --variant=hmsstaging --appIdSuffix=hms and I get the error of unable loading script. Then I have to run react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle myself to generate the bundle js and re-run react-native run android ... to get it work, but it fails to access debugging mode and throw error no device connected.
What is the proper way to let me able to access debugging mode in other android build variant?