Android, the standalone version of traceview is deprecated

Hesam picture Hesam · Feb 14, 2013 · Viewed 8k times · Source

I want to see my traces.

1- In code, I have added these lines of code:

// Start trace recording
android.os.Debug.startMethodTracing("hc_traceview");

and

// Stop trace recording
android.os.Debug.stopMethodTracing();

2- I can see "hc_traceview.terac" in file explorer of DDMS.

3- Based on Viewing Trace Files in Traceview, I ran following command in terminal:

@hesam-K5VD:~/Desktop/Eclipse/sdk/tools$ traceview /mnt/sdcard/hc_traceview

But out put is:

The standalone version of traceview is deprecated.
Please use Android Device Monitor (tools/monitor) instead.
trace file '/mnt/sdcard/hc_traceview' not found

4- Based on suggestion, I ran following command in terminal:

@hesam-K5VD:~/Desktop/Eclipse/sdk/tools$ monitor /mnt/sdcard/hc_traceview

DDMS opened but my traces are not here :( How can I see my traces?

Any suggestion would be appreciated.

Answer

Mr.Me picture Mr.Me · Feb 14, 2013

Please take a look here : DDMS

The page says you can start and stop method profiling inside DDMS view like this:

  • Launch your app from eclipse in debugging mode.
  • Go to DDMS View
  • In devices window there is a small button called Start Method Profiling
  • Click it when you want ( you can combine it with break points to get accurate start/end)
  • when you're done click Stop Method Profiling
  • A new window in DDMS will appear similer to traceview with the same output.