Brian Link
Brian Link

Reputation: 123

How to see error message in react-native ios release build?

I'm trying to debug an error that only pops up only in my release build. I'm running the app directly through xcode (and this applies to both simulator and real-device builds.) When I run the app and perform the actions that reliably produce the error, I can see that there was an error (and the stack trace) in xcode's console output. What I can't see is the error message.

Even if I manually add throw new Error('Its broken!') somewhere and trigger that, I can't see the error message. This makes doing any sort of debugging in the release build problematic.

I'm looking for a way to at least see error messages and ideally some tips on how to debug or step-through javascript code in the release build.

Example stack trace: https://gist.github.com/cpsubrian/6d7e9d7745fff10d2ab203bc5a357576

Note: The error in question is triggered by a particular call to realm.create() (realm-js), but I'm not sure how I can inspect/debug the params that are causing the error or the error itself.

Upvotes: 3

Views: 3432

Answers (1)

AliAvci
AliAvci

Reputation: 1197

Logging error messages in release mode

console.error should display in your XCode / Android Studio logs.

Managing bugs in released apps

For production ready error handling, depending on what your preferences are, there are tools such as the npm module react-native-exception-handler and a web app called bugsnag that you may use to manage crash reporting.

Upvotes: 1

Related Questions