Unity Profiler 使用 Android 真机连接测试

官方说明:https://docs.unity3d.com/2018.4/Documentation/Manual/profiler-profiling-applications.html

使用usb连接

官网说明:

  • Attach your device to your computer via cable and make sure that it shows in the adb
    devices list.
  • Go to the Build Settings (menu: File > Build Settings), enable the Development Buildcheckbox, and then select Build & Run
  • When the application launches on the device, open the Profiler window in the Unity Editor (menu: Window > Analysis > Profiler).
  • From the Attach to Player drop-down menu, select AndroidProfiler(ADB@127.0.0.1:34999). The entry in the drop-down menu is only visible when the selected target is Android.

翻译后:

  • 打开手机调试模式
  • 打开 Build Settings (menu: File > Build Settings),勾选 Development Build
  • 打开Profiler (menu: Window > Analysis > Profiler).
  • 点击Attach to Player ,选择AndroidProfiler(ADB@127.0.0.1:34999)
  • 勾选Enable Internal Profiler (menu: File > Build Settings>Player Settings >Other Settings).
    win系统打开cmd命令行,执行命令adb forward tcp:34999 localabstract:Unity-{在此处插入 Bundle ID}.
    例如 adb forward tcp:34999 localabstract:Unity-com.test.aoc

执行该命令时必须打开unity且电脑连接android手机,手机处于调试模式
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

使用wifi连接

  • Disable mobile data on your Android device.
  • Connect your Android device to your WiFi network. The Profiler uses a local WiFi network to send profiling data from your device to the Unity Editor.
  • Attach your device to your computer via cable. Go to the Build Settings (menu: File > Build Settings), enable the Development Build and Autoconnect Profiler checkboxes, then select Build & Run.
  • When the application launches on the device, open the Profiler window in the Unity Editor (menu: Window > Analysis > Profiler).
    Build Settings 里,将 Development Build、Autoconnect Profiler、Script Debugging 打开。

查看端口占用

  • netstat -ano|findstr “5037” 去查找5037对应的端口号的进程id 也就是pid。
  • tasklist |findstr “20120" 查看进程名字。
  • 用任务管理器 查看进程pid对应的进程,然后结束进程(打开任务管理器后右键勾选PID显示pid)

在这里插入图片描述

在这里插入图片描述

如果进程有守护进程,干不掉,则参考文章 https://blog.csdn.net/aLLLiyyy/article/details/86555228,最后面会说怎么结束掉

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值