Android - Can't use traceview

有些话、适合烂在心里 提交于 2019-12-01 20:55:45

问题


I am trying to use traceview to run some profiling against an Android application. I have wrapped the code that I want to trace with the following lines:

Debug.startMethodTracing("xxx");
// code
Debug.stopMethodTracing();

It successfully generated a trace file, that I pulled from sdcard using the following command line:

./adb pull /sdcard/xxx.trace

However when running traceview like this:

./traceview /.../xxx.trace

I am getting the following error message:

Usage: java com.android.traceview.MainWindow [-r] trace -r regression only

I cannot understand this error message and I didn't find anything useful on Google.

Any help would be much appreciated.

Thanks!


回答1:


make sure that Debug class you imported is this one : android.os.Debug

or do this :

android.os.Debug.startMethodTracing("xxx");
android.os.Debug.stopMethodTracing();


来源:https://stackoverflow.com/questions/6491855/android-cant-use-traceview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!