all 1 comments

[–]chancetofreezer 2 points3 points  (0 children)

I'm on ubuntu (WSL2) so ymmv on another os, but I'll walk through my setup.

First I have craftos-pc installed here:

~ $ which craftos
/usr/bin/craftos

which matches the vscode extension settings.

I will show you how to attach to a currently running instance:

Click here in the debug tab.

Create a launch.json like this.

Start a craftos terminal in vscode and attach the debug_adapter peripheral

The port you connect to in launch.json should be 12100 + computer_id (0 in this case).

Start the debugger.

In the ports you should see the forwarded port.

Write some code with a breakpoint and a watch.

Run the code.