VSCode and Debugger

I was able to get this to work. My approach was:

  1. Make sure you can build C_API/Examples/Hello World using CMake from the Terminal. This will ensure that you have all the right tools installed correctly (CMake, Xcode command line tools)
  2. In VSCode, install the "CMake Tools" extension
  3. Follow this guide to set it up: Get started with CMake Tools on Linux. I used the kit "Clang 13.0.0" and the variant "Debug"
  4. Set up your launch.json to use the simulator. The two lines you care about are:
    "program": "/Users/username/Developer/PlaydateSDK/bin/Playdate Simulator.app"
    "args": ["${workspaceFolder}/hello_world.pdx"],
  5. You should be good to go. Use Run -> Start Debugging, watch the Simulator launch your pdx, and your breakpoints will get hit.
4 Likes