-
Notifications
You must be signed in to change notification settings - Fork 1.2k
VS Code Direct Debugging
"Direct Debugging" allows you to debug JS while it's running directly in the client (as opposed to in the web debugger).
To set this up, you need to make a few code changes in your native code to configure direct debugging:
-In the app code that creates and sets DevSettings, you'll need to turn these settings on:
devSettings->useDirectDebugger = true;
devSettings->debuggerBreakOnNextLine = true;
devSettings->debuggerPort = 9229;
devSettings->useWebDebugger = false;
TODO: This needs to be updated to use InstanceSettings(), but this currently isn't fully working due to https://github.com/microsoft/react-native-windows/issues/4315
-In VS Code add a configuration like this:
{
"type": "node",
"request": "attach",
"name": "Attach to ReactTest direct debugger",
"protocol": "inspector",
"port": 9229
}
Launch your app
In VS Code, from the Debug menu, hit the play button with "Attach to ReactTest direct debugger" selected