Reputation: 1043
I'm always running react-native run-ios
, I tend to reset the emulator content and settings from time to time for regression purposes.
In order to go into debug mode, we have to CMD+D > Debug mode, but is there a command option so that the debugging mode is enabled right after react-native run-ios
(fresh install) command?
Closest question I've found is https://stackoverflow.com/a/41345139/1405577 but it does not work
$ react-native run-ios --install-debug
error: unknown option \`--install-debug'
Upvotes: 13
Views: 5128
Reputation: 506
You can do it with setIsDebuggingRemotely
from NativeModules
:
import { NativeModules } from 'react-native';
if (__DEV__) {
NativeModules.DevSettings.setIsDebuggingRemotely(true)
}
Then Debug JS Remotely will be activated on start.
Upvotes: 8