unity 聯機調試(android ios)

來源:互聯網
上載者:User

標籤:技術分享   基本   highlight   實參   build   tail   配置   profiler   成功   

http://blog.csdn.net/OnafioO/article/details/44903491

 

(這種沒用,只是在手機看到畫面而已)

手機安裝unityRemote並運行,unity中設定【edit】→【Perferences】,在External Tools中,設定Android SDK Location,串連usb後直接運行unity在手機上就能看到結果。

這種方法問題是使用這個unityRemote啟動並執行結果和打包出來的apk運行結果未必一致,

不清楚使用profiler查看的是否是真機的參數

但是可以使用代碼輸出調試

[csharp] view plain copy print?
  1. if (Input.GetKeyUp(KeyCode.Escape))   
  2. {      
  3.        Debug.Log("Return Button");            
  4. }  

 

2 unity打包android apk下載android sdk(unity版本和Android SDK Tools有一定對應關係,本文使用的是unity4.3.4  Android SDK Tools版本是22.0.1)

Edit->Perferences中設定android sdk位置


File->Build Settings,

然後在Inspector面板配置,首先更改下

再修改,最後可以建立個Keystore


然後可以點擊build進行打包,打包時報錯經常是因為unity版本和Android SDK Tools版本對不上,比如提示缺少zipalign.exe,aapt.exe等

解決方案是直接從\android-sdk-windows\build-tools\19.1.0\中把zipalign.exe,aapt.exe複製到android-sdk-windows\tools\中

其中zipalign.exe這個檔案只有build-tools 19.1.0以上的版本中才有

aapt.exe這個基本大多數版本的build-tools 都有


3 使用profiler查看真機運行參數 關閉行動數據(2g網)
 開啟wifi(手機和unity所在pc在同一子網)

 首先使用unity打包apk,打包時需要勾選

 然後build and run,運行成功手機直接顯示遊戲畫面,profiler自動彈出並顯示手機運行apk的真實參數

 如果 Unity 編輯器 (Editor) 自動連接裝置失敗,從分析器視窗 (Profiler Window) 的活動分析器 (Active Profiler) 下拉式功能表中選擇正確的裝置

 

android裝置通過usb串連(正確安裝驅動後)profiler中會多出兩個選項

官網原文  http://uec.unity3d.com/learning/document?file=/Manual/Profiler.html



IOS使用profiler查看包參數的方法與android基本一直,但需要使用mac上的unity進行調試

unity 聯機調試(android ios)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.