当前位置: 代码迷 >> Android >> android 应用程序性能追踪
  详细解决方案

android 应用程序性能追踪

热度:68   发布时间:2016-05-01 13:47:34.0
android 应用程序性能跟踪

So here's how you can optimize, analyze your current application using TraceView.
Open your Project, and after onCreate(), or anywhere you want to start Log tracing, paste the following lines:

?

/* start tracing to "/sdcard/filename.trace" */Debug.startMethodTracing("filename");

?It is very important to stop tracing after you have done debugging. To do that, place these lines before onCreate().

public void onDestroy() {	// stop tracing	Debug.stopMethodTracing();}

?Now run your Project, do anything you'd like to optimize, and quit. Open up DDMS File Explorer, and download /sdcard/filename.trace to your hard disk drive.

Go to your Android SDK folder, open Tools directory, and run ./traceview filename.trace

Here's how it looks like:

  相关解决方案