zoukankan      html  css  js  c++  java
  • Unity Profiler连接Android真机调试

      Profiler在Editor模式就可以观看性能消耗,但是毕竟电脑配置高,跟手机真机环境还是有区别。实际开发中的优化还是推荐用真机测试。

    因为IOS一般比Android手机的配置高,在Android平台做好优化一般在IOS也没太大问题,下面介绍Profiler连接Android真机调试。

    一  Profiler监测Unity打出包来直接运行到手机上的程序

      1 Android设备设置:

      手机开启开发者模式和USB调试

      2 Building Settings设置

      ① 切换为Android平台

      ② Build System选择Internal

      ③ Building Setting勾选Development Build,Autoconnect Profiler,Script Debugging。点击Building And Run。打包成功后程序运行起来

      ④ Add Open Scenes添加要测试的场景为当前场景

      3 打包:

      Android设备用USB数据线连接电脑,点击Build & Run进行打包。打包完成后,在Android设备上点击需要的授权信息,让程序在Android设备上跑起来。

     4 Profiler监测:

      ①    打包完成后unity自动打开Profiler窗口,如果Android设备上程序已经运行起来但是没有自动打开Profiler窗口的话,点击Window -> Profiler手动打开

      ②    在Profiler窗口点击Editor, 点击AndroidPlayer(ADB..) 选择监测Android设备选中Record开始监测。

      

    二 Profiler监测其他程序

    ① 手机开启开发者模式和USB调试

    ② 打开cmd命令行工具,cd到SDK中adb.exe的目录,我的在E:Androidandroid-sdk-windowsplatform-tools。

    然后输入adb forward tcp:34999 localabstract:Unity-包名,如adb forward tcp:34999 localabstract:Unity-com.company.product。

    ③   Window->Profiler,选择AndroidPlayer(ADB@127.0.0.1:34999),选中Record开始监测。

    如果你在测试的时候连接不上,

    1 保证防火墙没有屏蔽我们要连接的端口

    2 报错:Failed to connect to player ip:127.0.0.1,port:34999, 解决方法: 在打包时在Player Setting里勾选Enable Internal Profile就可以。

  • 相关阅读:
    springboot使用hibernate validator校验
    @Inherited:允许子类继承父类的注解。
    springboot跨域配置
    spring boot——MockMvc的用法 (SpringBoot 1.5.18)下测试通过
    spring boot(10) 基础学习内容
    关于Spring @RequestBody 自动映射模型原理
    @Requestbody@ApiParam @PathVariable @RequestParam三者区别
    《生成对抗网络入门指南【2】》
    《生成对抗网络入门指南【1】》
    《精通 CSS3 动画(学完这个课写炫酷页面)》
  • 原文地址:https://www.cnblogs.com/fengxing999/p/9958593.html
Copyright © 2011-2022 走看看