Unity Profiler联机调试工具:Profiling

安卓联调

Unity Profiler链接安卓手机调试一般通过USB连接手机并通过ADB来connect:

另外安卓手机上还可以用snapdragon和adreno等工具进行联机调试和逆向分析等。

iOS联调

iOS手机上联调unity profiler和安卓差不多,在build Xcode工程的时候debug下勾选development build和autoconnect profiler。

Unity Profiler联调Xcode性能分析

打开Xcode工程后,最好edit scheme设置metal api validation为enabled以获取更多的调试信息:

Unity Profiler联调Xcode性能分析

然后连接手机,运行工程,手机上跑起来后打开Unity Window下的Profiler窗口,这时Profiler会检测到可监控的设备,默认是Editor,改选成连接的iphone或ipad设备即可看到profiler信息:

Unity Profiler联调Xcode性能分析

Unity Profiler联调Xcode性能分析

但可以看到,ios设备联调profiler不支持显示GPU数据,因为ios设备是基于TBDR架构的,不能显示毫秒级别的一帧的时间信息,但可以利用Unity Internal Profiler等其他工具统计整个场景每帧的时间信息,GPU的忙碌程度:https://docs.unity3d.com/Manual/MobileProfiling.html?_ga=2.64417455.1686844176.1577417233-799672702.1577417233

相关文章: