Unity Profiler的使用


  選中Development Build、Autoconnect Profiler和Script Debugging三個選項,如下圖所示。

  

  點擊Build And Run按鈕,將會編譯項目並安裝APK到Android設備,同時會自動打開Profiler並顯示。

  手動安裝APK並啟動Unity Profiler的步驟如下圖所示。

  1.安裝APK並啟動;

  2.執行命令adb forward tcp:34999 localabstract:Unity-{insert bundle identifier here};

  3.在Unity Editor中通過菜單Window > Profiler,打開Profiler window;

  4.在Profiler中通過下拉菜單選擇Active Profiler;

  

   

  其中最為關鍵的一步是手動執行adb forward tcp:34999 localabstract:Unity-{insert bundle identifier here},這也是Autoconnect Profiler所做的工作之一。如果設備重啟,或adb斷開重連,需要再次執行該命令進行端口映射。如果Unity Profiler無法正常連接,可用adb forward --list命令查看當前已做映射的端口,確認當前Unity應用的端口已經做了映射。

  在Unity應用性能調優及分析界面卡頓或閃爍等問題時,Unity remote Profiler工具會非常有用。譬如下圖直觀反映出了Unity應用幀率較低(35FPS)的原因。

  

  參考:Working in Unity Advanced Development Profiler overview Profiler window


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM