In this post I’m going to show you how you can debug packaged builds with visual studio.
The process requires the following steps:
- Adding a break point somewhere in your code
- Including debug files for packaging
- Packaging your project with either Debug or Development Build Configuration
- Attaching the visual studio debugger to your game’s process
Since each project is different I’m going to assume you have already placed a breakpoint somewhere in your code. Once you do that, navigate to Project Settings -> Packaging -> Project
and make sure to:
- Enable either the Debug or Development option in the Build Configuration
- Include Debug Files
Once you complete these steps, package your build somewhere in your PC and run it. While the game is running open up the project’s visual studio solution and on the Debug dropdown menu select the “Attach to Process” option
Once you do that, in the menu that pops up:
- Select your packaged game from the list of processes
- Attach the debugger to it
Once you complete these steps you have to wait until your code steps into the breakpoint you have added in the 1st step. In my case, I’ve placed a breakpoint somewhere in my game’s instance and I can even watch the contet of the relevant variables for that particular block:
And that’s the whole process of attaching tthe debugger to your packaged builds! Thanks for reading!