美文网首页
Unity Android真机Profiler

Unity Android真机Profiler

作者: 不正经的搬砖工 | 来源:发表于2020-10-21 17:37 被阅读0次

1、打包

(1)如果是Build Settings下直接打包,则如图1-1勾选这三个选项:

图1-1

(2)如果是自己代码自动化打包,BuildOptions要包含一下选项:BuildOptions.Development、BuildOptions.ConnectWithProfiler、BuildOptions.AllowDebugging、BuildOptions.EnableDeepProfilingSupport。

2、打好包后在手机上启动,数据线连接电脑并调为开发者模式。然后PC进入CMD中输入以下指令:

adb forward tcp:34999 localabstract:Unity-包名

一定注意包名与Identification中的Package Name保持一致,如图2-1所示,我使用的指令应该为:

adb forward tcp:34999 localabstract:Unity-com.DefaultCompany.client

图2-1

3、首先确保防火墙关闭,Unity中打开Window->Analysis->Profiler,点击Playmode下拉框选择AndroidPlayer(ADB@127.0.0.1:34999),成功后如图3-1所示:

图3-1

相关文章

网友评论

      本文标题:Unity Android真机Profiler

      本文链接:https://www.haomeiwen.com/subject/eqeemktx.html