

Unity – android profiling via adb
source link: https://naclyen.com/2020/03/17/unity-android-profiling-via-adb/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

想必有很多人受到這種困擾, 最後有人受不了跑去decompiling, 才讓事情變得單純(?)
先講重點:
- 如果可以順利使用預設的
AndroidPlayer([email protected]:34999)
的話就直接使用即可.
但會看到這篇應該都是不能用的災民吧~哈哈!! - 建議先關掉所有防火牆/防毒軟體測試. (測試完記得開回來嘿!)
- 自訂IP的內容只需要填IP即可.
O: 127.0.0.1
X: 127.0.0.1:50000 - unity 偵測範圍落在
55000
~55511
. - 透過指令
adb forward tcp:[Port] localabstract:Unity-[Package Name]
打開adb的監聽渠道.
e.g. adb forward tcp:55000 localabstract:Unity-com.mygame.an
- 如果不行則在加另一個port, 直到都失敗為止.
- 至此還不行, 透過指令
adb forward --remove-all
把adb forward全砍了!! - 重複
5
&6
的步驟. - 至此還不行, 就另請高明了 |||Orz…
先依照官網的說明設定好.
預設管道第一天還可以直接使用, 隔天就GG. 而後找到了這篇同樣困惑的災民的教學.
馬上就可以順利運作了!! (灑花
但就在當天午餐後, 本來早上設定的 55000 莫名其妙又失效(可能是被占住), 再換另一個 port 即可.
推測應該是某一邊咬住了該 port 造成無法使用, 移除之後應該就可以順利運作?
…有效!
adb forward 所需要的 [Package Name] 來自 player setting 內的 Package Name
移除 forward
adb forward --remove tcp:8080
adb forward --remove-all
列出監聽 port 的清單
使用 netstat
.
On Windows: netstat -an | find /i "listening"
On Linux: netstat -an | grep "LISTEN " (notice the space after LISTEN)
Recommend
-
14
Android ADB Tricks for your shell to boost your productivity If you are Android developer and working a lot with different phones, there's a high chance you have collected a set of different scripts which help y...
-
15
局域网开启 Android ADB 无线调试 「 终端开发 」 —— 2020年11月23日 [本文结构] 最近因为家里事情比较多,因此晚上和周末都...
-
13
Matthew Miner Consolation Available via Unity Package Manager January 4, 2021 I upd...
-
9
ADB简介 Android Debug Bridge (adb) 是一个Android的命令行工具。可以用来连接模拟器或实际的移动设备。比如 adb logcat, adb shell。Dalvik Debug Monitor Server(DDMS) 后台也是运行的adb来实现监控调试移动设备。 总体而言,adb有两个用途...
-
8
想必有很多人受到這種困擾, 最後有人受不了跑去decompiling, 才讓事情變得單純(?) 先講重點: 如果可以順利使用預設的AndroidPlayer([email protected]:34999)的...
-
6
Tackling profiling for mobile games with Unity and Arm Mark Harkness, March 11, 2021 ...
-
6
ADB的全称为Android Debug Bridge,就是调试桥的作用,存放在sdk安装目录下的platform-tools文件夹中,借助这个工具,我们可以管理设备或手机模拟器的状态,可以让你与仿真实例或连接的安卓系统的设备进...
-
313
Android Studio - failed to start adb advertisements I recently started learning android programming using android studio but every time I open...
-
6
34个Android常用adb shell命令汇总 – Android开发中文站你的位置:Android开发中文站 > Android开发 >
-
31
Unity BlogProfiling in Unity 2021 LTS: What, when, and how
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK