{"id":13467140,"url":"https://github.com/facebook/stetho","last_synced_at":"2025-12-15T10:44:49.480Z","repository":{"id":26256688,"uuid":"29703871","full_name":"facebook/stetho","owner":"facebook","description":"Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.","archived":false,"fork":false,"pushed_at":"2024-10-26T03:44:45.000Z","size":2392,"stargazers_count":12699,"open_issues_count":83,"forks_count":1131,"subscribers_count":376,"default_branch":"main","last_synced_at":"2025-05-12T02:51:27.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://facebook.github.io/stetho/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebook.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-22T22:34:10.000Z","updated_at":"2025-05-09T09:12:34.000Z","dependencies_parsed_at":"2024-11-26T07:16:37.016Z","dependency_job_id":null,"html_url":"https://github.com/facebook/stetho","commit_stats":{"total_commits":344,"total_committers":60,"mean_commits":5.733333333333333,"dds":0.7383720930232558,"last_synced_commit":"2198797c0ff961dd2d9b87efa711a7d734c0e4d5"},"previous_names":["facebook/stetho","facebookarchive/stetho"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstetho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstetho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstetho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstetho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebook","download_url":"https://codeload.github.com/facebook/stetho/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672737,"owners_count":21945483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:00:53.476Z","updated_at":"2025-10-20T02:47:08.994Z","avatar_url":"https://github.com/facebook.png","language":"Java","readme":"# Stetho [![Build Status](https://travis-ci.org/facebook/stetho.svg?branch=master)](https://travis-ci.org/facebook/stetho)\n\n[Stetho](https://facebook.github.io/stetho) is a sophisticated debug bridge for Android applications. When enabled,\ndevelopers have access to the Chrome Developer Tools feature natively part of\nthe Chrome desktop browser. Developers can also choose to enable the optional\n`dumpapp` tool which offers a powerful command-line interface to application\ninternals.\n\nOnce you complete the set-up instructions below, just start your app and point\nyour laptop browser to `chrome://inspect`.  Click the \"Inspect\" button to\nbegin.\n\n## Set-up\n\n### Download\nDownload [the latest JARs](https://github.com/facebook/stetho/releases/latest) or grab via Gradle:\n```groovy\nimplementation 'com.facebook.stetho:stetho:1.6.0'\n```\nor Maven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.facebook.stetho\u003c/groupId\u003e\n  \u003cartifactId\u003estetho\u003c/artifactId\u003e\n  \u003cversion\u003e1.6.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOnly the main `stetho` dependency is strictly required; however, you may also wish to use one of the network helpers:\n\n```groovy\nimplementation 'com.facebook.stetho:stetho-okhttp3:1.6.0'\n```\nor:\n```groovy\nimplementation 'com.facebook.stetho:stetho-urlconnection:1.6.0'\n```\n\nYou can also enable a JavaScript console with:\n\n```groovy\nimplementation 'com.facebook.stetho:stetho-js-rhino:1.6.0'\n```\nFor more details on how to customize the JavaScript runtime see [stetho-js-rhino](stetho-js-rhino/).\n\n### Putting it together\nIntegrating with Stetho is intended to be seamless and straightforward for\nmost existing Android applications.  There is a simple initialization step\nwhich occurs in your `Application` class:\n\n```java\npublic class MyApplication extends Application {\n  public void onCreate() {\n    super.onCreate();\n    Stetho.initializeWithDefaults(this);\n  }\n}\n```\nAlso 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` :\n\n```xml\n\u003cmanifest\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        ...\u003e\n        \u003capplication\n                android:name=\"MyApplication\"\n                ...\u003e\n         \u003c/application\u003e\n\u003c/manifest\u003e                \n```\n\nThis brings up most of the default configuration but does not enable some\nadditional hooks (most notably, network inspection).  See below for specific\ndetails on individual subsystems.\n\n### Enable network inspection\nIf you are using the popular [OkHttp](https://github.com/square/okhttp)\nlibrary at the 3.x release, you can use the\n[Interceptors](https://github.com/square/okhttp/wiki/Interceptors) system to\nautomatically hook into your existing stack.  This is currently the simplest\nand most straightforward way to enable network inspection:\n\n```java\nnew OkHttpClient.Builder()\n    .addNetworkInterceptor(new StethoInterceptor())\n    .build()\n```\n\nNote that okhttp 2.x will work as well, but with slightly different syntax and you must use the `stetho-okhttp` artifact (not `stetho-okhttp3`).\n\nAs interceptors can modify the request and response, add the Stetho interceptor after all others to get an accurate view of the network traffic.\n\nIf you are using `HttpURLConnection`, you can use `StethoURLConnectionManager`\nto assist with integration though you should be aware that there are some\ncaveats with this approach.  In particular, you must explicitly add\n`Accept-Encoding: gzip` to the request headers and manually handle compressed\nresponses in order for Stetho to report compressed payload sizes.\n\nSee the [`stetho-sample` project](stetho-sample) for more details.\n\n## Going further\n\n### Custom dumpapp plugins\nCustom plugins are the preferred means of extending the `dumpapp` system and\ncan be added easily during configuration.  Simply replace your configuration\nstep as such:\n\n```java\nStetho.initialize(Stetho.newInitializerBuilder(context)\n    .enableDumpapp(new DumperPluginsProvider() {\n      @Override\n      public Iterable\u003cDumperPlugin\u003e get() {\n        return new Stetho.DefaultDumperPluginsBuilder(context)\n            .provide(new MyDumperPlugin())\n            .finish();\n      }\n    })\n    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))\n    .build())\n```\n\nSee the [`stetho-sample` project](stetho-sample) for more details.\n\n## Improve Stetho!\nSee the [CONTRIBUTING.md](CONTRIBUTING.md) file for how to help out.\n\n## License\nStetho is MIT-licensed. See LICENSE file for more details.\n","funding_links":[],"categories":["Java","Using DevTools frontend with other platforms","Debugging","Mobile Development","Libraries","Debug","库"],"sub_categories":["Browser Adapters","C++/C Toolkit","Debugging Tools","[](https://github.com/JStumpp/awesome-android/blob/master/readme.md#debugging-tools)调试工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Fstetho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebook%2Fstetho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Fstetho/lists"}