unity通过android adb查看真机日志
来源:互联网 发布:男性穿衣搭配软件 编辑:程序博客网 时间:2024/05/22 14:17
前几天跑某大公司面试,问我会不会在android真机调试的时候直接输出到控制台,当时有点懵逼,居然不知道控制台是什么东西了,居然理解成了输出到eclipse...我觉得程序没有通过eclipse打包,怎么可能输出到它里面去呢...等面试完了,回公司的路上才回过神来,那个黑框框不就是控制台么!!!
adb是androidSDK的一个工具,位置就在sdk目录下的platform-tools文件夹下。
通过adb,不仅可以查看在Unity中自己设定的打印信息,包括系统信息和异常都能获取到。是android开发的一个神器!
因为最近的某些游戏中的需求在搞android代码,很多都需要再真机上测试,eclipse又不知道怎么看日志,所以就一直用adb
打开控制台,输入如下命令:
adb logcat -s Unity -d > xxx.txt
运行以后,unity中的所有输出都会保存到目标文件中(注意填写完整路径)
其中Unity是过滤用的tag,unity中的所有输出都是“Unity”
如果要按等级进行查看,比如说只看错误信息,并且直接显示在控制台,可以这样写
adb logcat -s Unity:e
要查看所有的错误信息,包括系统的,那就这样写
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命令,需要配置环境变量,如果不配置环境变量,就直接写adb.exe的完整路径
0 0
- unity通过android adb查看真机日志
- unity通过android adb查看真机日志
- android adb通过wifi查看日志
- windows系统上通过adb查看android机器运行日志
- 安卓用adb查看unity程序日志
- adb命令行查看Android日志
- 通过adb shell操作android真机的SQLite数据库
- [Android基础]adb 通过wifi连接真机
- 查看iOS真机日志
- 查看iOS真机日志
- 通过adb logcat读取保存android日志
- adb 通过eclipse读取Android应用日志
- Android 怎么通过adb 查看ip信息
- Android 通过adb工具查看sqlite3数据库
- Android通过adb查看wifi密码
- android通过adb查看cup消耗
- Android ADB命令大全(通过ADB命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)
- Android ADB命令大全(通过ADB命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)
- 大一下学习总结
- border-bottom-style(下边框的样式)
- js 面试大全
- SEO工程实施流程、计划、规范
- 用GDB调试程序
- unity通过android adb查看真机日志
- HashMap源码分析(基于1.8)
- 远程过程调用RPC
- 04.Java 集合 - Stack
- Github Pages
- HTTP网页错误代码---网络、端口
- Do you want to know me?----Come in.
- A星寻路
- 数据库的各种语句