博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android设备连接Unity Profiler性能分析器
阅读量:6913 次
发布时间:2019-06-27

本文共 1546 字,大约阅读时间需要 5 分钟。

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进行性能分析了。

你可能感兴趣的文章
Selenium:三种等待方式
查看>>
关于脏读、不可重复读和幻读
查看>>
Maven详解(七)------ 创建Web工程以及插件原理
查看>>
二进制传输与文本传输的区别
查看>>
YMP运行初始化步骤
查看>>
Getting Started with the G1 Garbage Collector(译)
查看>>
MySql5.7.11 for Windows 安装精简版(一)
查看>>
Java线程池
查看>>
imx6设备树pinctrl解析【转】
查看>>
vue.js 入门
查看>>
Ansible系列(三):YAML语法和playbook写法
查看>>
JAVA线程池ScheduledExecutorService周期性地执行任务 与单个Thread周期性执行任务的异常处理...
查看>>
Python 面向对象
查看>>
JAXB xml与javaBean的转换
查看>>
ResultSet 的Type属性 TYPE_FORWARD_ONLY, TYPE_SCROLL_I
查看>>
C#多线程--线程池(ThreadPool)
查看>>
Android FileProvider相关 Failed to find configured root that contains
查看>>
【Win 10 应用开发】UI Composition 札记(七):基于表达式的动画
查看>>
2.lombok系列2:lombok注解详解
查看>>
redis——学习之路五(简单的C#使用redis)
查看>>