/*add by HanSyaun for showing code on article. start*/ /*add by HanSyaun for showing code on article. end*/

2018年3月4日 星期日

Unity2017.2在Mac上使用profiler連結android

重點:
Unity官方文件寫的adb指令中的34999沒有用,依照網友分享,必須使用55000 ~ 55511,或者4600
The ADB Commnad's number 34999 that mention in Unity document is not working. You should use 55000~55111, or 4600 instead.

1.確認防火牆已經關閉




2.build一個apk,選擇develpment build和auto connect profiler

3.找到你的bundle identifier(Package Name)

4.到User/yourUserName/Android/sdk/platform-tools路徑下找到adb。android sdk的路徑就是在unity preference->External Tools下的路徑

5.USB連上手機,打開APP。打開terminal,將adb拉到terminal上


6.後面貼上這句並修改為自己的bundle identifier:
forward tcp:55000 localabstract:Unity-yourBundleIdentifier
結果會像是:
/Users/yhs/Library/Android/sdk/platform-tools/adb forward tcp:55000 localabstract:Unity-com.abc.xxx

7.重新打開手機上的app與連結USB,退出任何手機/USB傳輸的程式
8.打開Unity profiler,選擇Enter IP,打上127.0.0.1。完成!應該要看到profiler出現資料了
 






 
https://docs.unity3d.com/Manual/ProfilerWindow.html
https://zhuanlan.zhihu.com/p/30247546

沒有留言:

張貼留言