我想保存方法调用的日志。Traceview 支持该功能,我可以获得 .trace 文件格式。
但是,我需要在没有 DDMS 的情况下打开 .trace 文件格式。
如果没有 DDMS 就无法打开 .trace 文件,如何获取方法调用日志?(最好是 .txt 文件格式。)
谢谢。
这是一个旧线程。
因为我在这里找到了,所以其他人可能也需要这个。
尝试这个:
traceview -r yourtrace.trace > 1.txt
看看 1.txt 对你有什么用处。
"traceview" is a command-line utility. You don't need to launch it from DDMS.
If you just want a text file with times and message names, you can use "dmtracedump -o file.trace".
一方面,您应该只使用 DDMS,它使用起来非常简单。即使您没有 eclipse,您也可以使用 SDK 附带的那个。但是,如果您已经可以访问,tracefile.trace
那么您可以简单地Traceview
从 SDK 中使用。只需打开您的命令提示符并导航到您的 androidSDK/tools
目录,如下所示:cd C:\Program Files\Android\android-sdk\tools
. 一旦出现,只需键入traceview
后跟文件名(可以省略 .trace),如下所示:traceview C:\Users\Sino\Desktop\Janky_trace_file
. 这应该以 GUI 表示形式打开您的跟踪文件,并具有深入研究您的方法调用的功能。
这很简单。 Eclipse:文件-->打开文件-->打开traveview文件(xxxx.trace)
If you have a ".trace" file, just use "traceview " from the command line and you should be able to view the content of the file. You can generate various graphs with the existing .trace file using the command line tool "dmtracedump". http://developer.android.com/tools/help/dmtracedump.html.