https://www.reddit.com/r/reactnative/comments/eaolge/best_approach_for_using_debugger/
Here's a description of the current setup for my debug attempt:
- In VS Code, select Debug > Start Debugging from menu
- ^ This displays a "DEBUG AND RUN" toolbar with "Debug Android" in the dropdown with Play icon next to it having a tooltip of "Start Debugging"
- My target component for debug has the following script ref before the import statements: <script src="http://localhost:8097" />;
- I trigger the in app dev menu on my Android emulator and then select the Debug menu option: adb shell input keyevent 82
I used this approach a few minutes ago and it was working but for some reason the breakpoints in my component stopped getting hit. The "Stop Debugging" option is displayed in the in-app dev menu in the emulator so it appears that the emulator is in a proper debug state.
The "DEBUG AND RUN" toolbar in my VS Code instance shows a little blue progress indicator running across the bottom of the toolbar with a pause button available in a separate toolbar to the left. The availability of the pause button appears to indicate that the debugger process is currently active but after a few minutes the following message is output to the debug console:
"Could not debug. Another debugger is already connected to packager. Please close it before trying to debug with VSCode. (error code 505)"
I wasn't sure it the VS Code debugger was somehow conflicting with the emulator debugger so I selected the "Stop Debugging" menu item from the in-app dev menu in the emulator. When I try to restart the debugger in VS Code I still get the same error message written out to the debug console in VS Code:
"Could not debug. Another debugger is already connected to packager. Please close it before trying to debug with VSCode. (error code 505)"
So I assume that some type of stale instance of the VS Code debugger is running somewhere in the background and needs to be terminated/restarted. Can you describe the easiest way to do this? Obviously I could restart my computer but I'm looking for the easiest way to do this with the smallest footprint when the VS Code debugger gets into a weird state like this.
submitted by /u/random503
[link] [comments]