Standalone app which provides a chrome dev tools style debugger
-
install
react-native-debugger:brew update && brew cask install react-native-debugger -
start debugger
npm run debug -
start app eg.
npm run start:ios
Standalone app which provides some features missing from React Native Debugger, ie. Network requests and Async Storage interaction
-
install on Mac using:
brew cask install reactotron
or follow the installation guide
-
open app
-
start app eg.
npm run start:ios
Debugging can be enabled in the emulator/simulator.
The debugging window will open in your browser by default when you choose the option in the emulator.
You can also listen (on http://localhost:8081) to this in your IDE of choice.
Javascript stack traces will be caught on production versions as non-fatal events in Crashlytics. The stack trace is of the minified bundle. To understand where in the code this happens to be you need to use a tool such as source-map to un-minify the crash.
npm i -G source-map-cli# to install source map- Get the appropriate map file for the version from CI
- Get the line and column number from the stack trace e.g. the stack trace may read
.onPress (index.android.bundle:885:559:885)The numbers are 885 and 559. source-map resolve index.android.js.map 885 559# this will give the source code file and line numbers e.g.
react-native-playground/src/modules/Home/Home.js:27:24
throw new Error('This is a test crash! Hello world')}}