Android开发调试神器Stetho使用

来源:互联网 发布:银泰百货庆春店 mac 编辑:程序博客网 时间:2024/05/16 08:11

一. 项目添加依赖。

  compile ‘com.facebook.stetho:stetho:1.3.1

二. 初始化 Stetho

 public class MyApplication extends Application {       public void onCreate() {         super.onCreate();         Stetho.initializeWithDefaults(this);         }    }

三. 修改网络请求(可选)

  new OkHttpClient.Builder() .    addNetworkInterceptor(new StethoInterceptor()) .build()

四. 运行你的项目

在chrome中访问 chrome://inspect   找到你的项目 点击 inspect
原创粉丝点击