如何用Logcat调试u3d信息?
2016-05-09 01:35
381 查看
基本上没有人愿意写错程序,基本上也没有人能写出不出错的程序,
特别是一次写成。反正活了几十年,没见过没错的和一次成功的,所以没有不真机调试的,(还有压测,游戏效率问题,但是真正懂得不是很多)
很善慕那些作家,随便写的东西都能出书,反正写出来的东西错了也就错了,个人文风,作者观点。最近公司一个小弟问为什么不用模拟器调试,我只能再次O嘴
我的用法还是简单的
清除之前Logcat的方法,其他也可以不用
其他logcat方法可参考这博客,但其实用的不多,不看也可,除非你是从事刷机软件开发,想必你也不会在360和百度工作
http://blog.csdn.net/avi9111/article/details/51205183
来源还是:
U3d官网论坛,网速还是不错,学学外文还是不错的
If you're using Unity with android, you must have already installed adb through Android SDK. Given that, yeah, it should be simple and obvious. And Ben is right. You didn't seem
to google enough or take any effort here... But I just hate simple unanswered questions.
So, quoting updated parts from Herman,
there are just a couple things to assure:
Make sure USB debugging is enabled on the Android device (check under Settings -> Development). - Run
the command prompt (with command line argument logcat) that comes with the Android SDK while running the game on the Android, still connected via USB to the computer.
And then, quoting eriQue,
here's a good command line to filter out stuff:
Finally, if the Android Debug Bridge can't help you, I'm not sure what could. There was this one time, actually, it couldn't help me... But I was ignoring a unity warning, so I did the debugging
checklist in the wrong order.
评论 · 隐藏
16 · 分享
Ranger
Ori · 2013年11月13日
15:28 0
First, thanks for the answer.
Second, here is what I didn't know. you wrote:
"Run adb through the command prompt (with command line argument logcat) that comes with the Android SDK while running the game on the Android, still connected via USB to the computer."
I had no clue that I needed to actually copy the cmd.exe file into the "platform-tools" folder and activate the command prompt in there so it would work. (or to write to exact location of the adb.exe file in cmd)
in no tutorial there was an explanation for this, and only this guide
actually explained that
Not all of us are Software Engineers.. otherwise I would'nt ask this question. :)
By the way, this utility only shows the unity console? or is there some more important info I can get using it?
Cawas · 2013年11月13日
15:36 0
You don't need to be an engineer to know about the command prompt. But that's cool, dude. I saw your pain, reason why I decided to write a detailed answer. Glad I could hit something! ;-)
This shows the android console. It has nothing to do with Unity, it doesn't even need to know Unity exists. There might be some more important info you can get using it, but that will most likely be true only if
you're using tools outside Unity (which you probably aren't).
Ranger
Ori · 2013年11月13日
15:39 0
Then how come I receive data from the unity console? anywhere I placed "Debug.Log()" in Unity is shown through the command prompt.
Bunny83 · 2013年11月13日
16:01 3
You really don't need (and shouldn't) copy cmd.exe into the android tools folder. adb is "just" a program. To run it you have to specify the right location of the program.
This can be done by:
"browsing" to the actual folder inside your command prompt where the adb exe is located. The "cd" command (change directory) might be useful.
Create a shortcut to adb.exe and edit the shortcut properties to add additional parameters you want to pass to adb
Same as above but more versatile: Create a shortcut to cmd.exe and change the working directory to the directory of your adb location. When you open the cmd with this shortcut it should start in the tools directory
and you can directly type "adb xxxx"
The most common one is to add the directory to the default
search path. This is what i do with most tools which i know i'm going to use them quite a lot ;). If you've done that, you can start the ADB from any command prompt from any directory. Keep in mind to restart cmd or the changes wouldn't apply. Before you
ask how you add an directory to the PATH environment variable, see
this
Giantbean · 2013年11月15日
16:50 2
Another Update: My trouble was corrupt drivers. uninstalling and re-installing never worked but a Universal
ADB driver got my phone recognized by ADB. Hope that helps others save some time.
特别是一次写成。反正活了几十年,没见过没错的和一次成功的,所以没有不真机调试的,(还有压测,游戏效率问题,但是真正懂得不是很多)
很善慕那些作家,随便写的东西都能出书,反正写出来的东西错了也就错了,个人文风,作者观点。最近公司一个小弟问为什么不用模拟器调试,我只能再次O嘴
我的用法还是简单的
adb logcat -s Unity ActivityManager
清除之前Logcat的方法,其他也可以不用
adb logcat -c
其他logcat方法可参考这博客,但其实用的不多,不看也可,除非你是从事刷机软件开发,想必你也不会在360和百度工作
http://blog.csdn.net/avi9111/article/details/51205183
来源还是:
U3d官网论坛,网速还是不错,学学外文还是不错的
<a target=_blank href="http://answers.unity3d.com/questions/492681/how-to-use-adb-logcat.html">http://answers.unity3d.com/questions/492681/how-to-use-adb-logcat.html</a>
If you're using Unity with android, you must have already installed adb through Android SDK. Given that, yeah, it should be simple and obvious. And Ben is right. You didn't seem
to google enough or take any effort here... But I just hate simple unanswered questions.
So, quoting updated parts from Herman,
there are just a couple things to assure:
Make sure USB debugging is enabled on the Android device (check under Settings -> Development). - Run
adbthrough
the command prompt (with command line argument logcat) that comes with the Android SDK while running the game on the Android, still connected via USB to the computer.
And then, quoting eriQue,
here's a good command line to filter out stuff:
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG
Finally, if the Android Debug Bridge can't help you, I'm not sure what could. There was this one time, actually, it couldn't help me... But I was ignoring a unity warning, so I did the debugging
checklist in the wrong order.
评论 · 隐藏
16 · 分享
Ranger
Ori · 2013年11月13日
15:28 0
First, thanks for the answer.
Second, here is what I didn't know. you wrote:
"Run adb through the command prompt (with command line argument logcat) that comes with the Android SDK while running the game on the Android, still connected via USB to the computer."
I had no clue that I needed to actually copy the cmd.exe file into the "platform-tools" folder and activate the command prompt in there so it would work. (or to write to exact location of the adb.exe file in cmd)
in no tutorial there was an explanation for this, and only this guide
actually explained that
Not all of us are Software Engineers.. otherwise I would'nt ask this question. :)
By the way, this utility only shows the unity console? or is there some more important info I can get using it?
Cawas · 2013年11月13日
15:36 0
You don't need to be an engineer to know about the command prompt. But that's cool, dude. I saw your pain, reason why I decided to write a detailed answer. Glad I could hit something! ;-)
This shows the android console. It has nothing to do with Unity, it doesn't even need to know Unity exists. There might be some more important info you can get using it, but that will most likely be true only if
you're using tools outside Unity (which you probably aren't).
Ranger
Ori · 2013年11月13日
15:39 0
Then how come I receive data from the unity console? anywhere I placed "Debug.Log()" in Unity is shown through the command prompt.
Bunny83 · 2013年11月13日
16:01 3
You really don't need (and shouldn't) copy cmd.exe into the android tools folder. adb is "just" a program. To run it you have to specify the right location of the program.
This can be done by:
"browsing" to the actual folder inside your command prompt where the adb exe is located. The "cd" command (change directory) might be useful.
Create a shortcut to adb.exe and edit the shortcut properties to add additional parameters you want to pass to adb
Same as above but more versatile: Create a shortcut to cmd.exe and change the working directory to the directory of your adb location. When you open the cmd with this shortcut it should start in the tools directory
and you can directly type "adb xxxx"
The most common one is to add the directory to the default
search path. This is what i do with most tools which i know i'm going to use them quite a lot ;). If you've done that, you can start the ADB from any command prompt from any directory. Keep in mind to restart cmd or the changes wouldn't apply. Before you
ask how you add an directory to the PATH environment variable, see
this
Giantbean · 2013年11月15日
16:50 2
Another Update: My trouble was corrupt drivers. uninstalling and re-installing never worked but a Universal
ADB driver got my phone recognized by ADB. Hope that helps others save some time.
相关文章推荐
- 神器SystemTap
- Python 七步捉虫法
- 选定虚拟主机 性能凸显优势
- 修改一行代码提升 Postgres 性能 100 倍
- redis的hGetAll函数的性能问题(记Redis那坑人的HGETALL)
- 推荐Sql server一些常见性能问题的解决方法
- Lua编程示例(一):select、debug、可变参数、table操作、error
- SQL Server误区30日谈 第9天 数据库文件收缩不会影响性能
- 和表值函数连接引发的性能问题分析
- SQLServer 2000 升级到 SQLServer 2008 性能之需要注意的地方之一
- C#中的两种debug方法介绍
- 数据库性能优化三:程序操作优化提升性能
- VBS中的字符串连接的性能问题
- mysql 性能的检查和调优方法
- 用Ruby实现一个单元测试框架的教程
- 数据库性能优化二:数据库表优化提升性能
- SQL语句性能优化(续)
- SQL语句优化提高数据库性能
- 如何用分表存储来提高性能 推荐
- ASP中使用FileSystemObject时提高性能的方法