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(ADB@127.0.0.1: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 project的时候一定要勾选 Development Build

然后在手机上打开游戏。

打开Unity Profiler窗体选择(ADB@127.0.0.1:54999)

然后就能在Profiler进行性能分析了。


更多相关文章

  1. Android(安卓)在安装完成界面,点击打开应用程序。在应用程序点击h
  2. Mac android 环境配置
  3. android 下载网络pdf文件后并显示
  4. Android(安卓)SQLiteOpenHelper Sqlite数据库的创建与打开
  5. Android--取得MD5指纹,取得MapKey
  6. Android(安卓)App性能优化之内存优化
  7. Android高性能编码四:代码优化
  8. 如何通过网页打开Android(安卓)APP
  9. Android(安卓)应用初始化及窗体事件的分发

随机推荐

  1. Android 小項目之---猜撲克牌遊戲 (附源碼
  2. Android-网络框架04Retrofit2.0+RxJava
  3. 使用SharedPreferences存储和读取数据
  4. DataBinding 的简单使用
  5. Android 硬件加速的优缺点
  6. Android Drawable 系列——ClipDrawable
  7. android语音识别和合成第三方
  8. Android shape实现订单卡片制作(shape画半
  9. Android(安卓)事件分发源码分析
  10. Xamarin开发Android时Visual Studio 2012