安卓手機日誌擷取

來源:互聯網
上載者:User

標籤:code   log   top   report   抓取log   系統   meminfo   stat   bsp   

安卓應用開發完成,有些時候是沒有將日誌儲存的遠端或是本地的,當出現問題了,也不容易定位。

那麼非開發人員,可以藉助android-sdk-windows的adb shell完成日誌查看

 

//輸出系統狀態資訊至F:\test\dumpstate.txt,由於需要root許可權,所以沒root的過的手機輸出為空白adb shell dumptate >F:\test\dumpstate.txt//輸出過去系統的狀態,log,一般操作過程中未抓取log的時候一旦出現問題就使用這個命令來查看adb shell bugreport >F:\test\bugreport.txt//輸出核心資訊adb shell dmesg//輸出當前緩衝區日誌 並儲存adb shell logcat    >F:\test\bugreport.txt//輸出記憶體資訊adb shell dumpsys meminfo//輸出當前CPU使用方式資訊adb shell dumpsys cpuinfo//輸出當前activity使用方式資訊adb shell dumpsys activity//相當於過濾,只找名為"mF"的activity使用方式資訊adb shell dumpsys activity | find "mF"//擷取按鍵資訊,在手機沒有按鍵 資訊的情況下會先提示你每個裝置的ID代表的裝置資訊,按鍵過程中會即時重新整理adb shell getevent//擷取系統屬性adb shell getprop//查看pm協助資訊adb shell pm//查看手機內的安裝包列表adb shell pm list packages//查看當前手機進程資訊adb shell ps//擷取cpu使用方式,只查看一次,不即時重新整理adb shell top -n 1//擷取前十的cpu使用方式,只查看一次,不即時重新整理adb shell top   -n 1 -m 10//查詢各進行記憶體消耗情況adb shell procrank//詳細查詢某個包的記憶體使用量情況adb shell dumpsys meminfo packageName

 

安卓手機日誌擷取

相關文章

聯繫我們

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