1. 程式人生 > >Android手機用Unity Profiler檢視效能

Android手機用Unity Profiler檢視效能

使用Unity Profiler檢視Android手機上執行效能資料,以下是官方文件:

Android

Remoteprofiling can be enabled on Android devices through two different paths : WiFiorADB.

For WiFiprofiling, follow these steps:

  1. Make sure to disable Mobile Data     on your Android device.
  2. Connect your Android device to     your WiFi network.
  3. Attach your device to your Mac/PC     via cable, check the “Development Build” and “Autoconnect Profiler”     checkboxes in Unity’s build settings dialog, and hit “Build & Run” in     Unity Editor.
  4. When the app launches on the     device, open the profiler window in Unity Editor (Window->Profiler)
  5. If the Unity Editor fails to     autoconnect to the device, select the appropriate device from the Profiler     Window Active Profiler drop down menu.Note: The Android device and     host computer (running the Unity Editor) must both be on the same
    subnet
    for the device detection to work.

For ADB profiling,follow these steps:

  • Attach your device to your Mac/PC     via cable and make sure ADB recognizes the device (i.e. it shows inadb     devices list).
  • Check the “Development Build”     checkbox in Unity’s build settings dialog, and hit “Build & Run”.
  • When the app launches on the     device, open the profiler window in Unity Editor (Window->Profiler)
  • Select the AndroidProfiler([email protected]:54999)     from the Profiler Window Active Profiler drop down menu.Note: The     Unity editor will automatically create an adb tunnel for your application     when you press “Build & Run”. If you want to profile another     application or you restart the adb server you have to setup this tunnel     manually. To do this, open a Terminal window / CMD prompt and enter:

adb forward tcp:54999 localabstract:Unity-{insert bundle identifier here}

Note: Theentry in the drop down menu is only visible when the selected target isAndroid.

If you areusing a firewall, you need to make sure that ports 54998 to 55511 are open inthe firewall’s outbound rules - these are the ports used by Unity for remoteprofiling.

官方這裡介紹了兩種聯調方式:wifi和用資料線連線的adb模式,這裡推薦用adb模式,資料反饋更為及時。這裡我們採用adb來聯調。

簡單羅列一下官方步驟:

1.   將你的手機裝置採用adb的方式與PC/Mac相連

2.   釋出Unity Android Apk時,勾選“Development Build”和“AutoConnect Profiler”選項

3.   開始執行手機程式後,點開Window->Profiler選擇AndroidProfiler([email protected]:54999)

4.   手動開啟adb的連線,開啟CMD,輸入:adb forward tcp:54999localabstrack:Unity-com.WJ.SwDemo2;(注意:這裡的com.WJ.SwDemo2請填寫執行應用程式的Bundle Identifier

注意:這裡要注意防火牆不能遮蔽埠:54998-55511

下面記錄一下聯調過程中發現的問題和解決方案,以供參考~

1.    開啟防火牆埠54998-55511

2.   輸入adb聯調命令:

開啟CMD(快捷鍵WIN+R),

輸入:adb forwardtcp:54999 localabstract:Unity-com.WJ.SwDemo2,回車;

如上圖:

1)        回車後,還無法連線,輸入:adb nodaemon server,發現埠5037已被佔用

2)        輸入:netstat –ano | findstr “5037”,檢視5037被哪些程序佔用

3)        輸入:taskkill /f /pid 5900(這裡是上面查出的程序pid),終止佔用5037的程序

4)        輸入:adb forward tcp:54999 localabstract:Unity-com.WJ.SwDemo2,發現5037還不能連

5)        輸入:adb start-server,重新啟動adb,然後再輸入4)所示adb連線程式碼

6)        開啟手機應用程式,並確保Profiler選擇AndroidProfiler([email protected]:54999)模式,即可在電腦上檢視應用的效能資料

相關推薦

Android手機Unity Profiler檢視效能

使用Unity Profiler檢視Android手機上執行效能資料,以下是官方文件: Android Remoteprofiling can be enabled on Android devices through two different paths : WiF

Android裝置連線Unity Profiler效能分析器

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

Android手機wifi連線adb除錯的方法

ic_adb_green_black_48dp.png 0x0 前言 Android開發肯定要連線pc的adb進行除錯,傳統的方法是用usb與pc進行連線,操作簡單即插即用,缺點是pc上必須得有對應手機的usb驅動程式,對於谷歌親兒子系列和三星摩托等外國品牌而言這不是什麼

FileExplorer檢視android手機中的資料庫

想檢視一下手機中的通訊錄資料庫,google之後找到了辦法。 1.window->show view->other 2. 輸入 file 查詢 3. 出來了吧 4. 可惜啊,data資料夾死活打不開啊, 看這個辦法 On rooted device you can do this:

Android調相機實現拍照並裁剪圖片,調手機中的相冊圖片並裁剪圖片

!= findview create 圖片剪裁 顯示 parent 學會 true mfile 在 Android應用中,非常多時候我們須要實現上傳圖片,或者直接調用手機上的拍照功能拍照處理然後直接顯示並上傳功能,以下將講述調用相機拍照處理圖片然後顯示和調用手機相冊中的

unity直連android真機在Profiler性能分析測試

unity androi 如果 dash 分析 窗口 tcp 是不是 屏蔽 基礎步驟: 1、Unity打開你要測試的項目:File–Build Settings 2、如下圖,按圖順序進行1、2、3、4、5操作,如果做過了,2就是灰色的,不能被點擊,4和5

Battery Historian 3.0分析android手機電池消耗

Battery Historian安裝方法見https://github.com/google/battery-historian 目前是Battery Historian3.0版本 第一種方法是使用docker映象,因為映象位於google雲,最後docker run命令根本就連不上。

Unity 開啟Android手機相簿和攝像頭

需求:要實現開啟手機的相簿和攝像頭,選擇照片或者拍照後,在unity進行。   1.android外掛 我使用的是AndroidStuido來寫外掛,下面是一步步介紹流程 (1)建立android工程 注意紅框裡面的東西,要修改兩個地方:

MAC Android Studioandroid手機進行除錯並實時同步在電腦上顯示(錄屏gif體積小清晰)

第一步:Mac電腦使用Android Studio進行真機除錯 第二步:Vysor:一款連線Android裝置和Chrome的神奇工具! 第三步:翻牆(藍燈)下載Vysor chrome外掛 第四步:Vysor chrome外掛破解 1.9.3 (Mac) 破解可以顯示更高清的

unity Profiler效能分析

A. WaitForTargetFPS:        Vsync(垂直同步)功能所,即顯示當前幀的CPU等待時間     B. Overhead:        Profiler總體時

Android手機root,檢視sqllite資料庫檔案

除錯手機紅米note4 1.自行百度,獲取紅米note4手機root許可權 2.cmd 開啟dos彈窗 3.輸入adb shell  -->  su--->  chmod 7777 /data  ----->  chmod 7777 /data/dat

OPPO手機android studio run 出現 Didn't find class DexPathList 解決方案

oppo手機不支援  instant Run  所以你如果要在用oppo手機debug  應用必須取消Instant Run 還有別的一些解決方案 推薦看這個https://stackoverflow.com/questions/19523167/an

Android使用adb命令來檢視手機的耗電資訊

1、測試前,需要將手機的電量資訊清空:adb shell "dumpsys batterystats --reset" 2、獲取手機的所有耗電資訊:       第一步:adb shell "dumpsys batterystats > /sdcard

-------怎麼程式碼判斷Android手機的Rom是MIUI及獲取MIUI版本

http://blog.csdn.net/devilkin64/article/details/19415717 參考Android原始碼: https://code.google.com/p/cyanogen-updater/source/browse/trunk/src

怎麼程式碼判斷Android手機的Rom是MIUI及獲取MIUI版本

轉載: 參考原始碼 在Android shell模式下輸入 getprop 就能獲取系統屬性值 如果Rom是miUI那麼就會有以下欄位. [ro.miui.ui.version.code

AndroidSPDY協議提高移動端網路請求效能

    本文旨在提出一種提高移動端網路效能的可行方案。我們知道目前移動端使用的網路請求協議基本上都是http。用的最多的是http/1.1,http/2.0正在逐漸壯大,實際上http/2.0是基於google提出的SPDY協議改進而來。廢話不多說,馬上進入正題

[工作筆記之三] 通過adb檢視android手機CPU和記憶體佔用情況

      最近邱同學讓我整理一下快看測試的效能指標,問了一下老大,他跟我說了響應時間、資源利用率和吞吐量這些。這裡先了解一下手機的CPU和記憶體的檢視方法,不過測試效能裡的資源利用率好像說的是伺服器端的,不知道有沒有搞錯。先記錄一下手機端的吧。 1. 開啟DOS視窗,進入

unity-Profiler除錯Android的正確姿勢

使用 unity 自帶的 Profiler 除錯 打出來的 Android 包 這裡使用 夜神模擬器 作為安卓裝置,當然你也可以用真機 1. 前置條件 安卓的相關環境 ja

android手機命令列下不能使用sqlite3命令檢視*.db資料庫檔案解決辦法

        最近工作有點忙,沒有空閒的時間來寫部落格了。最近在研究Android手機系統的知識,下面總結一下我在開發過程中遇到的問題。android手機命令列下不能使用sqlite3命令檢視*.db資料庫。 一.原因如下: 在system/xbin目錄下

NDK呼叫Android手機自帶的openssl庫函式

目標: 目前很多Android手機已經自帶了openssl庫, 即libssl.so, libcrypto.so, 以下示例實現了APK通過NDK呼叫openssl庫函式PKCS5_PBKDF2_HMAC(金鑰生成演算法) 1) 在android工程中建立 jni目錄 2)