How do you debug a crash in a React Native release build?

← React Native answers

Reproduce it in a release build, read the native log (Logcat or Xcode console) for the real error, and map minified JavaScript stack traces back with source maps.

Debug builds hide many problems that only appear in release: minification, Hermes bytecode, disabled dev warnings and stricter native optimizations.

npx react-native run-android --mode release
npx react-native run-ios --mode Release
 
adb logcat *:E          # Android errors
# iOS: run from Xcode and watch the console, or use Console.app for a connected device
  • Decide first whether it is a JavaScript error (a red-screen exception in debug, a silent exit or JS stack in release) or a native crash (a signal such as SIGSEGV, or a Java exception in Logcat).
  • For JavaScript, generate source maps during the release build and use them to turn bundle line numbers into file and function names.
  • For native crashes on Android, keep the ProGuard/R8 mapping file; on iOS, keep the dSYM files, so stack traces can be symbolicated later.

Keeping those symbol files for every release you ship is what makes a crash report from a user's phone readable weeks later.

Bugsee captures crashes and the session leading up to them in React Native apps, with symbolication for both JavaScript and native frames. Learn more

Related questions

Start debugging smarter today

Try Bugsee for free — no commitments, no hidden fees.

Free sign upLive demoNo credit card required