Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, the standalone version of traceview is deprecated

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.

like image 538
Hesam Avatar asked Feb 14 '13 09:02

Hesam


3 Answers

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.
like image 174
Mr.Me Avatar answered Oct 23 '22 11:10

Mr.Me


You should pull the trace out of the sdcard as follows:

cd your sdk/platform-tools
$ adb pull /sdcard/hc_traceview.trace
open the monitor (double click monitor.bat in sdk/tools). click "Open File..." and select the hc_traceview.trace from the sdk/platform-tools folder. You should now have clean view of your trace. If any problem appear, please comment here.

like image 40
user2558461 Avatar answered Oct 23 '22 09:10

user2558461


After the DDMS opened, you have to click on the File menu and select "Open File...", then select the trace file generated in the before step, all the trace info will be displayed.

like image 42
Ryan Avatar answered Oct 23 '22 10:10

Ryan