Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

stetho

> 编程语言
Open source

Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.

12.7K stars0 likes1 views
WebsiteGitHub

About

Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.

Stetho

Stetho is a sophisticated debug bridge for Android applications. When enabled, developers have access to the Chrome Developer Tools feature natively part of the Chrome desktop browser. Developers can also choose to enable the optional dumpapp tool which offers a powerful command-line interface to application internals.

Once you complete the set-up instructions below, just start your app and point your laptop browser to chrome://inspect. Click the "Inspect" button to begin.

Set-up

Download

Download the latest JARs or grab via Gradle:

groovy
implementation 'com.facebook.stetho:stetho:1.6.0'

or Maven:

xml
<dependency>
  <groupId>com.facebook.stetho</groupId>
  <artifactId>stetho</artifactId>
  <version>1.6.0</version>
</dependency>

Only the main stetho dependency is strictly required; however, you may also wish to use one of the network helpers:

groovy
implementation 'com.facebook.stetho:stetho-okhttp3:1.6.0'

or:

groovy
implementation 'com.facebook.stetho:stetho-urlconnection:1.6.0'

You can also enable a JavaScript console with:

groovy
implementation 'com.facebook.stetho:stetho-js-rhino:1.6.0'

For more details on how to customize the JavaScript runtime see stetho-js-rhino.

Putting it together

Integrating with Stetho is intended to be seamless and straightforward for most existing Android applications. There is a simple initialization step which occurs in your Application class:

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

Also ensure that your MyApplication Java class is registered in your AndroidManifest.xml file, otherwise you will not see an "Inspect" button in chrome://inspect/#devices :

xml
<manifest
        xmlns:android="http://schemas.android.com/apk/res/android"
        ...>
        <application
                android:name="MyApplication"
                ...>
         </application>
</manifest>                

This brings up most of the default configuration but does not enable some additional hooks (most notably, network inspection). See below for specific details on individual subsystems.

Enable network inspection

If you are using the popular OkHttp library at the 3.x release, you can use the Interceptors system to automatically hook into your existing stack. This is currently the simplest and most straightforward way to enable network inspection:

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

Note that okhttp 2.x will work as well, but with slightly different syntax and you must use the stetho-okhttp artifact (not stetho-okhttp3).

As interceptors can modify the request and response, add the Stetho interceptor after all others to get an accurate view of the network traffic.

If you are using HttpURLConnection, you can use StethoURLConnectionManager to assist with integration though you should be aware that there are some caveats with this approach. In particular, you must explicitly add Accept-Encoding: gzip to the request headers and manually handle compressed responses in order for Stetho to report compressed payload sizes.

See the stetho-sample project for more details.

Going further

Custom dumpapp plugins

Custom plugins are the preferred means of extending the dumpapp system and can be added easily during configuration. Simply replace your configuration step as such:

java
Stetho.initialize(Stetho.newInitializerBuilder(context)
    .enableDumpapp(new DumperPluginsProvider() {
      @Override
      public Iterable<DumperPlugin> get() {
        return new Stetho.DefaultDumperPluginsBuilder(context)
            .provide(new MyDumperPlugin())
            .finish();
      }
    })
    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))
    .build())

See the stetho-sample project for more details.

Improve Stetho!

See the CONTRIBUTING.md file for how to help out.

License

Stetho is MIT-licensed. See LICENSE file for more details.

Issues· 85 open

View all issuesOpen on GitHub
  • #724

    Release a new version

    Updated Nov 5, 2025
  • #696

    DevTools inspect window doesn't render properly

    Updated May 17, 2025
  • #722

    Is this project still alive?

    Updated Jan 23, 2025
  • #615

    Software rendering doesn't support hardware bitmaps

    Updated Feb 21, 2023
  • #714

    Inspect Devices UI is distorted

    Updated Jan 28, 2023
  • #708

    Usage of weak crypto algorithms like SHA-1 in Stetho

    Updated Oct 31, 2022
  • #701

    How fix this?

    Updated Oct 21, 2022
  • #707

    NoSuchMethodError issue

    Updated Dec 29, 2021
  • #706

    Feature request to view datastore data

    Updated Nov 16, 2021
  • #705

    Stetho doesn't capture network in network inspector

    Updated Nov 5, 2021

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言