UE真机调试
UE真机调试
Android
出包的环境配置参考
https://docs.unrealengine.com/5.2/zh-CN/how-to-set-up-android-sdk-and-ndk-for-your-unreal-engine-development-environment/
APK + 符号表
VS + AGDB == 还没跑通
https://developer.android.com/games/agde
https://developer.android.com/games/agde/quickstart
Android Studio
Profile or Debug Apk
>> URL
- 选择需要调试的APK
- Debug type设置为Dual (Java + Native),使得可同时调试java代码和c++代码
- LLDB Startup Commands设置为:
command script import "<..>\Engine\Extras\LLDBDataFormatters\UE4DataFormatters.py"
可使用更友好的方式来查看ue4数据类型
1 command script import "E:\UnrealEngine\Engine\Extras\LLDBDataFormatters\UEDataFormatters.py"
调试已存在的工程
- 其他设置类比 Debug Apk 的步骤
- 直接把要断点的文件拖进AS,下断点即可
- 有没有添加添加工程的形式,方便的多?不用一个文件一个文件的拖进去
支持的操作行为
动态修改
修改代码,本地编译 后替换
libue4.so
或libUnreal.so
编译指令参考
1
G:\AEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe AClient Android Development -Project=D:\AClient\trunk\AClient\AClient.uproject D:\AClient\trunk\AClient\AClient.uproject -NoUBTMakefiles -remoteini="D:\AClient\trunk\AClient" -skipdeploy -Region=ROW -Manifest=G:\AEngine\Engine\Intermediate\Build\Manifest.xml -NoHotReload -log="G:\AEngine\Engine\Programs\AutomationTool\Saved\Logs\UBT-AClient-Android-Development.txt"
其他问题
修改 ADB 端口被占用
IOS
I found a solution, you need to make sure the
UE4/Engine/Extras/LLDBDataFormattersUE4DataFormatters.py
script gets called when Xcode compiles.According to the install instructions in that script:
Open Terminal and run:
1 2touch ~/.lldbinit open ~/.lldbinit
Add the following text to
.lldbinit
and save - modifying the path as appropriate: settings set target.inline-breakpoint-strategy always command script import “/Path/To/Epic/UE4/Engine/Extras/LLDBDataFormatters/UE4DataFormatters.py” Then in Xcode you need to go to Product->Scheme->Edit Scheme
Windows
附加到正在运行的游戏
- Debug->Attach to Process
从 Visual Studio 启动
条件断点
判断 FString
1
wcscmp((wchar_t*)MyFString.Data.AllocatorInstance.Data,L"String2Cmp") == 0
判断 FName
1
strstr(((FNameEntry&)GNameBlocksDebug[MyFName.DisplayIndex.Value >> FNameDebugVisualizer::OffsetBits][FNameDebugVisualizer::EntryStride * (MyFName.DisplayIndex.Value & FNameDebugVisualizer::OffsetMask)]).AnsiName,"String2Cmp")
通用方式 - UE_DEBUG_BREAK()
1
2
3
4
if (MyFName.ToString().Contains("String2Cmp"))
{
UE_DEBUG_BREAK();
}
调试函数表达式返回值
- “调试”>“窗口”>“Autos/局部变量”