react-nativereact-native-debugger

How start remote debug on the very first run in react native


How start remote debug on the very first app run in react native?

I use developer menu to start Open debugger and the app reloads so it's not possible to debug code that occurs on a very first run only.


Solution

  • I have finally found a solution in this article.

    It's possible to start Open Debugger programmatically on iOS

    import { NativeModules } from 'react-native';
    
    if (__DEV__) {
     NativeModules.DevSettings.setIsDebuggingRemotely(true)
    }
    

    react-native-devsettings-android library is required to run this code on android