unity在android真機上的調試

來源:互聯網
上載者:User

標籤:android   ar   for   sp   on   cti   bs   ad   時間   

做unity一段時間了,一直耳聞unity可以在android上真機調試,挂念了好久,總算成功調試了。

網上相關資料感覺很少,特此記錄分享。

過程如下:

1.打android版本包,需要注意的是要勾選debug的那三個選項勾,分別是development build, antoconnect profiler(串連剖析器),script debugging(指令碼調試)

2.在android上運行程式,不啟動並執行話,unity profiler和mono無法找到程式。

3.此時開啟unity editor中的profiler視窗,點選active看profiler中應該就能看到真機裝置的選項了。如果沒有的話,繼續往下看。

4.真機調試需要輸入以下命令,profiler串連失敗的也可以試下。

adb forward tcp:54999 localabstract:Unity-<insert bundle identifier here>

舉個例子吧 
adb forward tcp:54999 localabstract:Unity-com.test.test

意思是把本地連接埠重新導向到後面的unix域上去了,反正應該可以連上。如果還失敗的繼續往下看。

5.此處我有一個猜測,如果再失敗的話,可以試試把adb的路徑添加到系統路徑上。

6.能看到profile的話,可以試下mono的attach,看有沒有真機的選項,如果有的話,就可以掛上調試了,不行繼續往下看。

7.需要注意的是,手機和調試機應該在一個網段下。

8.再不行。。再不行就去unity官網看看文檔或者google吧。。

unity在android真機上的調試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.