dependencies {
// Stetho core
compile 'com.facebook.stetho:stetho:1.3.1'
//If you want to add a network helper
compile 'com.facebook.stetho:stetho-okhttp3:1.3.1'
}
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
init();
}
private void init(){
Stetho.initializeWithDefaults(this);
new OkHttpClient.Builder()
.addNetworkInterceptor(new StethoInterceptor())
.build();
}
}
接着运行app到手机上。
然后打开chrome,输入网址chrome://inspect
网友评论