Using Oculus Debugger for VS Code
Oculus Debugger is a Visual Studio (VS) Code extension that is primarily intended for real-time debugging of Unreal Engine and Native apps for Meta Quest headsets. It fully supports debugging Meta Quest applications (APK files) and Meta Quest Native C/C++ binaries and is integrated with Unreal Engine’s project generator.
Features of the Oculus Debugger Extension - Attaches to and/or launches targets defined in
launch.json
. - Supports debugging native C/C++ (ELF) binaries.
- Supports debugging Meta Quest apps shipped via APK files.
- Integrates with Unreal Engine, which produces a VS Code workspace file with build and launch configurations.
- Uses LLDB debugger, which is downloaded from Meta servers so no additional setup is required.
- Supports setting breakpoints or watch variables, stepping over lines of code, stepping into executed functions, views of running threads, and their stacktraces.
- Download and install VS Code from the VS Code website.
- Open VS Code and click the Extensions icon.
- Search “Oculus Debugger” from MS Marketplace and then install it.
Debugging Unreal Projects
This section describes the setup necessary to create the workspace files required to use the extension to debug Unreal projects.
To set up the workspace files, follow these steps:
- Use the Oculus Source Distribution of Unreal.
- Make sure your code project is located under the
UE4/Projects
directory. Blueprints-only projects are not supported. - Run
GenerateProjectFiles.bat -VSCode
in the UE4 root directory on the command line to generate the VS Code workspace. - Open
UE4.code-workspace
in the UE4 root directory in VS Code. - Use
PROJECTNAME Oculus (Development) Launch
to launch the debugger. This will automatically build your UE4 project before launching.
Note: To reduce the time needed to launch the application when debugging, cooking is skipped and only source code is compiled. If you need to cook assets, you can do so from VS Code by running Ctrl-Shift-P > Task: Run Task > PROJECTNAME Android Development Cook.
- Using the Command Palette to execute Clean LLDB caches and Oculus Runtime downloads can be helpful if the debug session is stuck. If the session can’t start and it’s unclear what the issue is, the problem is sometimes in broken LLDB caches or Meta Quest runtime installations. In those situations clearing them by using this command may help resolve the issue.
- If you are having trouble and wish to file a bug report, you can submit a bug report at (https://github.com/facebookexperimental/oculus-debugger-vscode/). To file a bug from within VS Code, use the links in the Marketplace or use Help: Report Issue from the Command Palette. You can also click the Tweet Feedback button in the bottom-right corner and select the Submit a Bug link.