Packaging an Unreal Engine project allows you to run the application you created for the target platform.
Packaging a project includes the optimization and the transformation of the data format for the target platform.
Therefore, we sometimes face with the problem when packaged on these phases.
You can debug in the editor, by simply creating a C++ project and selecting "DebugGame Editor.
However, we can not follow same method for the packaged projects.
This article explains how to debug packaged projects by using Visual C++.
Prerequirement
Unreal Engine Version | 5.1 |
OS | Windows |
Target Platform | Windows |
Procedure
Right click on the Unreal Engine project file (the .uproject
file) and execute [Generate Visual Studio project files].
Open the Visual C++ solution file (.sln
file) and build the project.
At this time, select [DebugGame Editor] for the solution configuration.
To create a C++ project, please also refer to the following article.
Open your Unreal Engine project file.
Click on [Platforms] at the top of the screen and navigate to [Windows] in the menu.
From the menu item [BINARY CONFIGURATION], select [DebugGame].
Click on [Platforms] at the top of the screen and navigate to [Windows] in the menu.
From the [CONTENT MANAGEMENT] menu, select [Package Project].
A window will open to specify where to save the generated files after the build.
Once the location is specified, the project start packaging.
If the project is successfully packaged, an executable file Windows/DebugPackagedProject/Binaries/Win64/-Win64-DebugGame.exe
will be generated.
If the build fails, an error message will appear in the [Output Log], so check and fix the error.
Run the executable file generated by the project packaging will launch the application.
Attach to the process of the launched application.
Open the Visual C++ solution file and run [Debug] > [Attach to Process].
A new window will be created.
Select the name of the process you want to attach.
The name of the process is the same as the name of the executable file.
Once the process is attached, you can debug on Visual C++.
You will be able to debug by using breakpoints and so on.
Summary
This article explained how to debug a packaged project.
We can often see that the behavior will be changed after packaging even for the same implementation.
If we implement by using C++, the packaged application sometimes does not work correctly.
Also, debugging the packaged application is difficult.
We hope that this article will help you to improve the efficiency of debugging packaged applications.