9

I'm currently facing an issue which only exists in production/release build for Android. Is it possible to run debugger or view logs for production/release builds?

Simon Bao
  • 91
  • 1
  • 4

3 Answers3

4

Use console.log, console.warn, etc.

You can try simply run the following to see logs in the console:

react-native log-ios
react-native log-android

Reference: https://stackoverflow.com/a/38056698/9877424

Md. Robi Ullah
  • 1,703
  • 3
  • 20
  • 32
3

Try the following:

Run the logger for android using the following:

npx react-native log-android

Then run your app in release mode:

npx react-native run-android --variant=release

All of your console.log() and console.warn() should be displayed.

-3

Maybe this or this could help.

Try something with

if (__DEV__) {
    //log in dev build
} else {
   //log in product build
}
SuperSec
  • 134
  • 9