Android的跟踪文件创建,但零字节长 [英] Android trace file created but zero bytes long
问题描述
我试图遵循这个网页的指示来创建一个跟踪文件。我可以看到在文件浏览器文件中的DDMS,可以把它到我的电脑,但它是零字节长。
I am trying to follow the instructions on this page to create a trace file. I can see the file in File Explorer in DDMS and can pull it onto my PC but it is zero bytes long.
任何建议,我可能是做错了,好吗?
Any suggestions as to what I might be doing wrong, please?
推荐答案
这个问题似乎一直是我已经把在的onDestroy()方法(如建议在开发指南)没有停止,即使我曾试图结束活动的三种不同的方式跟踪...旋转屏幕,pressing Home键,并使用Taskiller杀应用程序。
The problem seems to have been that the stopMethodTracing() call which I had put in the onDestroy() method (as suggested in the Dev Guide) failed to stop the tracing even though I had tried three different means of ending the activity ... rotating the screen, pressing the Home Key and using Taskiller to kill the app.
通过移动stopMethodTracing()在其他地方我现在有一个数据一丝呢!
By moving the stopMethodTracing() elsewhere I now have a trace with data in it!
(重要线索是,我注意到,在LogCat中TRACE报告开始,但从来没有报道TRACE打断)。
(The vital clue was that I noticed that LogCat was reporting TRACE STARTED but never reported TRACE STOPPED.)
这篇关于Android的跟踪文件创建,但零字节长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!