Android裝置串連Unity Profiler效能分析器

來源:互聯網
上載者:User

標籤:unity   profiling   效能   

Unity提供兩種方式讓Developer的Android裝置串連Profiler進行效能分析:

1、通過wifi,Android裝置和電腦處於同一個Wlan中。

2、通過USB ADB


一般情況我們的電腦都是網線,所以我們採用ADB的方式。相比與wifi,ADB也更及時的反應裝置效能。


官方的英文文檔如下:

http://docs.unity3d.com/Manual/Profiler.html

For ADB profiling, follow these steps:    Attach your device to your Mac/PC via cable and make sure ADB recognizes the device (i.e. it shows in adb devices list).    Check the “Development Build” checkbox in Unity’s build settings dialog, and hit “Build & Run”.    When the app launches on the device, open the profiler window in Unity Editor (Window->Profiler)    Select the AndroidProfiler([email protected]:54999) from the Profiler Window Active Profiler drop down menu. Note: The Unity editor will automatically create an adb tunnel for your application when you press “Build & Run”. If you want to profile another application or you restart the adb server you have to setup this tunnel manually. To do this, open a Terminal window / CMD prompt and enter adb forward tcp:54999 localabstract:Unityinsert bundle identifier hereNote: The entry in the drop down menu is only visible when the selected target is Android.If you are using a firewall, you need to make sure that ports 54998 to 55511 are open in the firewall’s outbound rules - these are the ports used by Unity for remote profiling.

按照文檔的步驟,這裡我來翻譯一下:

首先我們先設定ADB:

開啟CMD命令列視窗,輸入以下命令:

adb forward tcp:54999 localabstract:Unity-com.thisisgame.gamedemo

然後 從Unity中Export Android 工程的時候一定要勾選 Development Build

然後在手機上開啟遊戲。

開啟Unity Profiler視窗選擇([email protected]:54999)

然後就能在Profiler進行效能分析了。


Android裝置串連Unity Profiler效能分析器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.