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'
In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.
There are two main ways in which we can use them: By writing the debugger statement in our source code. By clicking on a specific line of the code in the Chrome web browser (or Firefox, Edge, etc.) Developer Tools.
Click the Add Configuration button that shows up when you open the file, then click on React Native. This will bring up another menu that will ask you what kind of debugging configuration you want to create. Choose Debug application.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With