Configure your debugging tool to debug Unity in Windows
Set up Visual Studio or Windows Debugger to debug Unity applications or the Unity Editor.
Read time 2 minutesLast updated 12 days ago
Set up Windows Debugger (WinDbg) or Visual Studio to resolve Unity symbols so you can debug your Unity applications or the Unity Editor.
If your debugging tool is already set up to resolve Unity symbols and you want to know how to set up live or forensic debugging, refer to:
Set up Windows Debugger (WinDbg) to debug Unity
Follow these instructions to configure Windows Debugger (WinDbg) to automatically download and resolve Unity store symbols. When WinDbg has access to these symbols, you can use it to debug your application or the Editor.
-
Open WinDbg as administrator.
-
Go to File > Attach to process. A list of applications shows in the window.
-
In the list, choose the application you want to debug:
- To debug the Editor, use .
Unity.exe - To debug your built game, use the .exe file of your game.
- To debug the Editor, use
-
Select Attach. WinDbg connects to your application, which might take a few minutes.
-
Enter the following into the Command window in WinDbg to add Unity symbols to your debugger:.sympath+ SRV*c:\symbols-cache*http://symbolserver.unity3d.com/
As a result, WinDbg is ready to debug your Unity Editor or application.
Detailed breakdown of the code
.sympath+ SRV*c:\symbols-cache*http://symbolserver.unity3d.com/.sympath+
.sympath+SRV*c:\symbols-cache
The indicates a remote server to fetch from. The is a local path to cache the downloaded symbols. Before WinDbg retrieves symbols, it checks that path first so it doesn't download the same symbol multiple times. You can change this path to any directory on your system.
SRVc:\symbols-cache*https://symbolserver.unity3d.com/
This is the URL of the symbol store which your debugging software will fetch from.
Set up Visual Studio to debug Unity
Follow these instructions to configure Visual Studio (2019 or later) to automatically download and resolve Unity store symbols. When Visual Studio has access to these symbols, you can use it to debug applications or the Editor.
- Open Visual Studio.
- Go to Tools > Options.
- Expand the Debugging section and then select Symbols.
- Specify a cache directory if not already specified.
- Click Add (+). This adds a new symbol location to the Symbol file (.pdb) locations list.
- Enter into the new list entry.
https://symbolserver.unity3d.com/
Visual Studio is ready to debug your Unity code.