简介

  1. Stetho 由 Facebook 开发的一款查看 Android 数据库、SharePreference、网络拦截器的利器,通过与 Chrome 的配合使用,使 Android App 开发过程中对数据库等达到“心知肚明”的效果。
  2. 优点: 开发设备不需要 root
  3. Stetho 官网

使用

  1. 在 build.gradle 添加

     dependencies {
    compile 'com.facebook.stetho:stetho:1.5.0'
    compile 'com.facebook.stetho:stetho-okhttp3:1.5.0' //okhttp 网络拦截器
    }
  2. 在 Application 中初始化

     Stetho.initializeWithDefaults(this);
  3. 手机连接到电脑,在 Chrome 中打开:

     chrome://inspect/#devices

  4. 查看到自己需要调试的包名,点击 inspect

  5. 在新打开的 Developer Tools 页面,如下

  6. 功能介绍:

    1. Elements: 可以查看当前页面的布局文件
    2. NetWorks: 网络框架 okhttp 配置了网络拦截器,就可以看到 app 的网络情况
    3. Resources:
      1. WebSQL: 数据库文件
      2. Local Storage: SharePreference 文件
  7. 在使用 Okhttp 的地方,初始化的时候添加网络拦截器

     .addNetworkInterceptor( new StethoInterceptor())
  8. 在 NetWork 中可以看到添加拦截的网络请求。

参考:http://www.cnblogs.com/zhaoyanjun/p/6543411.html

Android 调试利器:Stetho + Chrome的更多相关文章

  1. Android调试神器stetho使用详解和改造

    本文由云+社区发表 作者:NaOH 概述 stetho是Facebook开源的一个Android调试工具,项目地址:facebook/stetho 通过Stetho,开发者可以使用chrome的ins ...

  2. 手机网页调试利器: Chrome

    新开发的网页需要在手机或是模拟机上运行测试, 可以借助 Chrome提供的手机网页预览程序进行简单调试.查看 制作的网页是否能够适合各种手机型号使用. 下面所以下如何使用Chrome调试多类型手机网页 ...

  3. OkHttp+Stetho+Chrome调试android网络部分

    如果要达到上面的效果,你需要改造你的网络请求模块,使用Chrome浏览器和android程序之间的中间件来连接,这就是本篇要介绍的主题:OkHttp+Stetho+Chrome进行网络调试. okht ...

  4. OkHttp+Stetho+Chrome调试android网络部分(原创)

    android网络调试一直是一个比较麻烦的部分,因为在不同序列的请求中,返回的数据会有不同的变化,如果能像web开发一样使用调试功能查看页面的访问数据该是多么美好的事情! 很幸运的是,现在Androi ...

  5. Stetho简化Android调试(二)

    Stetho简化Android调试(一) 一文中讲述了如何使用Stetho结合Chrome远程调试Android App. Stetho给我们调试带来很大的便利,效率显著提升的同时也产生一个问题:如果 ...

  6. android:如何通过chrome远程调试APP中的webView的h5代码

    今天出现一个问题,在老板的Mate9 Pro上,我们APP的所有H5页面都是一片空白,但是在其他手机上都是好的,那么我们就怀疑是h5报错了,但是到底是什么错,无法得知,所以就想要可以像在pc的chro ...

  7. hbuilder在android手机里用chrome调试,只显示了设备名称,却没有inspect按钮

    stark 通过“菜单”->“工具”->“检查设备”打开设备检查页面,只显示了设备名称,却没有inspect按钮,要怎么办 1 赞2014-10-09 22:00 ============ ...

  8. 通过Chrome浏览器进行android调试/Remote Debugging on Android with Chrome

    The way your web content behaves on mobile can be dramatically different from the desktop experience ...

  9. 手机H5 web调试利器——WEINRE (WEb INspector REmote)

    手机H5 web调试利器--WEINRE (WEb INspector REmote) 调试移动端页面,优先选择使用chrome浏览器调试,如果是hybrid形式的页面,可以使用chrome提供的ch ...

随机推荐

  1. Ulua_toLua_基本案例(二)_ScriptsFromFile

    在Untiy中用Lua.必需要LuaInterface. LuaInterface的介绍请看:点击打开链接 能够先光写Lua,生成.lua的纯文件. 再Unity中通过,luaState.DoFile ...

  2. 图解Ajax工作原理

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6126542.html Ajax指Asynchronous JavaScript and XML(异步的 Jav ...

  3. Oracle Data Integrator 12cR1 (12.1.3.0.0)安装过程

    Oracle Data Integrator 12cR1 (12.1.3.0.0)安装过程 下载安装文件 Oracle Data Integrator 12cR1 (12.1.3.0.0) http: ...

  4. Dynamic Lotusscript

    Introduction This short article gives an introduction to the underrated Execute method that is avail ...

  5. Spring Cloud开发实践 - 02 - Eureka服务和接口定义

    服务注册 EurekaServer Eureka服务模块只有三个文件, 分别是pom.xml, application.yml 和 EurekaServerApplication.java, 内容如下 ...

  6. 不同类型的磁盘存储在Ubuntu下的性能测试

    Ubuntu下通过lsusb判断USB存储是否是USB3.0: # 要查看Seagate这个移动硬盘 lsusb 或者 lsusb -t $ lsusb Bus Device : ID : Intel ...

  7. 使用Cygwin登录Raspberry PI

    偿试了很多ssh终端程序,像ScureCRT,Putty,SSHSecureShellClient,SSH Client Tunnelier,每个工具都有自己的特点,putty对中文的支持还算好的,其 ...

  8. postmessage and sendmessage

    从msdn上看二者的解释: postmessage : Places (posts) a message in the message queue associated with the thread ...

  9. 命令行参数解析函数getopt和getopt_long函数【转】

    原文地址:http://blog.csdn.net/cashey1991/article/details/7942809 getopt和getopt_long函数   平时在写程序时常常需要对命令行参 ...

  10. Yslow---一款很实用的web性能测试插件

    YSlow可以对网站的页面进行分析,并告诉你为了提高网站性能,如何基于某些规则而进行优化. YSlow可以分析任何网站,并为每一个规则产生一个整体报告,如果页面可以进行优化,则YSlow会列出具体的修 ...