国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
unity通過android adb查看真機日志

前幾天跑某大公司面試,問我會不會在android真機調(diào)試的時候直接輸出到控制臺,當時有點懵逼,居然不知道控制臺是什么東西了,居然理解成了輸出到eclipse...我覺得程序沒有通過eclipse打包,怎么可能輸出到它里面去呢...等面試完了,回公司的路上才回過神來,那個黑框框不就是控制臺么?。?!

adb是androidSDK的一個工具,位置就在sdk目錄下的platform-tools文件夾下。

通過adb,不僅可以查看在Unity中自己設(shè)定的打印信息,包括系統(tǒng)信息和異常都能獲取到。是android開發(fā)的一個神器!

因為最近的某些游戲中的需求在搞android代碼,很多都需要再真機上測試,eclipse又不知道怎么看日志,所以就一直用adb

打開控制臺,輸入如下命令:

adb logcat -s Unity -d > xxx.txt

運行以后,unity中的所有輸出都會保存到目標文件中(注意填寫完整路徑)

其中Unity是過濾用的tag,unity中的所有輸出都是“Unity”

如果要按等級進行查看,比如說只看錯誤信息,并且直接顯示在控制臺,可以這樣寫

adb logcat -s Unity:e

要查看所有的錯誤信息,包括系統(tǒng)的,那就這樣寫

adb logcat -s *:e

下面是adb logcat的幫助信息:

octopus@octopus:~$ adb logcat --help  Usage: logcat [options] [filterspecs]  options include:    -s              Set default filter to silent.                    Like specifying filterspec '*:s'    -f <filename>   Log to file. Default to stdout    -r [<kbytes>]   Rotate log every kbytes. (16 if unspecified). Requires -f    -n <count>      Sets max number of rotated logs to <count>, default 4    -v <format>     Sets the log print format, where <format> is one of:                      brief process tag thread raw time threadtime long      -c              clear (flush) the entire log and exit    -d              dump the log and then exit (don't block)    -t <count>      print only the most recent <count> lines (implies -d)    -g              get the size of the log's ring buffer and exit    -b <buffer>     Request alternate ring buffer, 'main', 'system', 'radio'                    or 'events'. Multiple -b parameters are allowed and the                    results are interleaved. The default is -b main -b system.    -B              output the log in binary  filterspecs are a series of     <tag>[:priority]    where <tag> is a log component tag (or * for all) and priority is:    V    Verbose    D    Debug    I    Info    W    Warn    E    Error    F    Fatal    S    Silent (supress all output)    '*' means '*:d' and <tag> by itself means <tag>:v    If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.  If no filterspec is found, filter defaults to '*:I'    If not specified with -v, format is set from ANDROID_PRINTF_LOG  or defaults to "brief"  


沒用過的可以嘗試一下,注意adb命令,需要配置環(huán)境變量,如果不配置環(huán)境變量,就直接寫adb.exe的完整路徑

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
adb logcat 基本用法
Android之抓取adb logcat全日志后怎么過濾掉只包含當前app進程的日志(一般抓啟動app奔潰日志)
Reading and Writing Logs | Android Developers
Android LogCat使用詳解-移動開發(fā) - 轉(zhuǎn)載
logcat使用
Android軟件測試的日志文件(Log文件)之多少
更多類似文章 >>
生活服務(wù)
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服