2 dongming86 dongming86 于 2016.01.27 15:46 提问

Android logcat信息保存问题

请问:在Eclipse中的Android项目中,logcat添加了一个logcat filter,如何把这个logcat filter对应的所有信息保存到txt文档中?
数据很多,logcat只是显示的后面的一部分,现在想全部把标签的信息保存下来

2个回答

rui888
rui888   Ds   Rxr 2016.01.27 15:53

Save LogCat To A Text File

So you already know how to view LogCat in Eclipse but now you want to copy the content of LogCat and you can't do it easily from Eclipse.

To save LogCat to a text file open up a terminal window and type:
adb logcat -d > logcat.txt

This will create a file named "logcat.txt" in your current directory. The -d option indicates that you are dumping the current contents and then exiting. If you do not use this option new lines of LogCat will be appended to the file, which may be useful.

Since LogCat can get pretty large very quickly you may want to clear it every once in a while, you can do this easily from Eclipse or from a terminal window using the command:
adb logcat -c

Note that running adb logcat without any options will display the contents of LogCat in your terminal window.

For fancier terminal manipulation of LogCat check out
http://developer.android.com/guide/developing/tools/adb.html#logcat

rui888
rui888   Ds   Rxr 2016.01.27 16:01
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!