Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Stetho | 12,627 | 3,097 | 25 | 2 months ago | 13 | March 30, 2021 | 83 | mit | Java | |
Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more. | ||||||||||
Puphpeteer | 1,319 | 15 | 12 | 5 months ago | 13 | December 01, 2020 | 64 | mit | PHP | |
A Puppeteer bridge for PHP, supporting the entire API. | ||||||||||
Node Devtools | 52 | 8 years ago | other | JavaScript | ||||||
Bridge between v8 debugging protocol and Chrome Remote Debugging Protocol | ||||||||||
Hermes | 13 | 2 | 4 | 5 years ago | 4 | July 01, 2018 | mit | JavaScript | ||
Developer tool designed to help teams to collaborate in the use of third party services — HTTP tunneling | ||||||||||
Webview_addallowedwebobjectworkaround | 13 | 5 years ago | mit | C# | ||||||
Workaround for lack of AddAllowedWebObject in Win32 WebView | ||||||||||
C3bridge Server | 8 | a year ago | 1 | other | C++ | |||||
The C3 Bridge Interface Server is a lightweight network application that allows remote clients to execute requests to the KUKA Cross 3 subsystem |
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.
Download the latest JARs or grab via Gradle:
implementation 'com.facebook.stetho:stetho:1.6.0'
or Maven:
<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:
implementation 'com.facebook.stetho:stetho-okhttp3:1.6.0'
or:
implementation 'com.facebook.stetho:stetho-urlconnection:1.6.0'
You can also enable a JavaScript console with:
implementation 'com.facebook.stetho:stetho-js-rhino:1.6.0'
For more details on how to customize the JavaScript runtime see stetho-js-rhino.
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:
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
:
<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.
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:
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.
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:
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.
See the CONTRIBUTING.md file for how to help out.
Stetho is MIT-licensed. See LICENSE file for more details.