Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Android設備連接Unity Profiler性能分析器

Android設備連接Unity Profiler性能分析器

編輯:關於Android編程

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 here

Note: 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進行性能分析了。


  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved