Check the @Tanis answer.
Also you can use something like this:
Add the library only on debug version.
dependencies {
debugCompile 'com.facebook.stetho:stetho:1.1.1
}
In your Application you can do :
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
StethoUtils.install(this);
}
}
Then you can create different StethoUtils
class in the debug/release version.
In src/debug/java/
public class StethoUtils{
public static void install(Application application){
Stetho.initialize(
Stetho.newInitializerBuilder(application)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(application))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(application))
.build());
}
}
In src/release/java/
public class StethoUtils{
public static void install(Application application){
// do nothing
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…