2

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.

Stanislav Mayorov
  • 4,298
  • 5
  • 21
  • 44

2 Answers2

4

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

Stanislav Mayorov
  • 4,298
  • 5
  • 21
  • 44