3、盒子上如何获取log
a、进入shell获取log
adb kill-server
adb connect dest-ip
adb shell 【登录shell】
mount -o remount /system /system 【改变权限】
logcat >> 1.log
命令行输入CTRL+C回到cmd命令行,adb pull path/1.log
b、直接在cmd命令行获取log
adb connect 连上后;
adb shell
adb logcat >> path/1.log
操作完毕后
命令行输入CTRL+C回到cmd命令行,adb pull path/1.log
c、在terminal终端直接输出log
回车切到shell
logcat [此时即可看到打印]
4、Eclipse环境下运行(安装了Android插件),那么直接可以在Eclipse就可以查看了

5、常用技巧
1、logcat中会打印 【输出级别 + LOG_TAG名字 + 进程字 + 打印的信息】可以充分利用这些信息分析问题
I/SystemServer( 939): Activity Manager
I/ActivityManager( 939): Memory class: 96
E/AndroidRuntime( 939): Error reporting WTF
第一列由 Log.i(e/w..决定) 或者 LOGI/LOGE/LOGW...
第二列由 LOG_TAG / TAG(JAVA)中决定,可以对于同一组模块前相同的前缀 [xxx]funtion 这种命名
第三列是系统进程号 getpid() 这值,打印线程值 pthread_slef()
最后的就是自行增加的打印信息
2、调效效率或者执行时间
1、建议重点的打印增加前缀,方便查找。以[######]
2、直接利用logcat输出时间,调试执行速度,分析效率
logcat -v time 【Display the date, invocation time, priority/tag, and PID of the originating process.】
更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11
