Lots of dependencies rely on the debug module for debug output. When debugging a React Native app with Chrome Developer tools, you can enable the debug output with
window.localStorage.debug = 'namespace'
in the console.
However, sometimes you need the debug output without running your app in Chrome's V8 context due to some subtle differences between the Javascript execution engines.
In order to achieve this, you can simply add enableDebug.js
to your project and import it in your index.js
like this:
import enableDebug from "./enableDebug";
enableDebug("*"); // this enables all debug output, look in the debug documentation for configuration options
After that you will see your debug output and that of your dependencies by running
react-native log-android
# resp.
react-native log-ios
in a terminal.