Android调试工具Stetho

  • 在应用中集成Stetho
dependencies {

    implementation 'com.facebook.stetho:stetho:1.5.0'
}

  

    • Stetho GitHub地址https://github.com/facebook/stetho
    • 新建Application类
      public class MyApplication extends Application {
          @Override
          public void onCreate() {
              super.onCreate();
              Stetho.initializeWithDefaults(this);
          }
      }
      
    • 清单文件里注册application
      <?xml version="1.0" encoding="utf-8"?>
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.safeluck.floatwindow">
          <!--API LEVEL>=23 悬浮窗需要此权限-->
      <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
          <application
              android:allowBackup="true"
              android:icon="@mipmap/ic_launcher"
              android:label="@string/app_name"
              android:roundIcon="@mipmap/ic_launcher_round"
              android:name=".app.MyApplication"
              android:supportsRtl="true"
              android:theme="@style/AppTheme">
              <activity android:name=".MainActivity">
                  <intent-filter>
                      <action android:name="android.intent.action.MAIN" />
      
                      <category android:name="android.intent.category.LAUNCHER" />
                  </intent-filter>
              </activity>
       
          </application>
      
      </manifest>
      

 

 

  • chrome浏览器输入chrome://inspect/#devices,在Chrome DevTools点击Inspect
    • attention:Chrome DevTools首次打开需要FQ,否则会打不开(出现404),只要成功打开过一次后续就不需要FQ了,推荐布谷鸟有一天的免费体验期

 

  • 打开Chrome DevTools 就可以方便查看app界面布局、网络请求数据、SQLite数据库、SharePreference等信息,而且手机设备不需要root

posted on 2018-08-24 10:36  endian11  阅读(191)  评论(0)    收藏  举报

导航