LeackCanary的使用

1、添加依赖

1  dependencies {
2    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
3    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
4    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
5  }
2、在Application中配置

1 public class CustomApplication extends Application {
 2     @Override
 3     public void onCreate() {
 4         super.onCreate();
 5         if (LeakCanary.isInAnalyzerProcess(this)) {
 6             return;
 7         }
 8         LeakCanary.install(this);
 9     }
10 }

你可能感兴趣的:(Android性能调试工具)