Debugging Android using Facebook Stetho Library


1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)


Tung Dao Xuan,, is the author of this article and he contributes to RobustTechHouse Blog



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

In this tutorial, you are going to learn how to integrate an Android project with Stetho (version 1.3.1) and use Google Chrome’s developer tools to debug it.


How to setup

  • Gradle
  • Initializing Stetho

Create a class that extends Application and initialize Stetho inside its onCreate() method.

In AndroidManifest.xml file, add MyApplication class into application tag as following:

Once you complete the set-up instructions above, just start your app and point your laptop browser to ‘chrome://inspect’. Click the “Inspect” button to begin.

Your browser



  • Inspecting databases

Click the Resources tab and select Web SQL. If your app has any SQLite databases, they will be listed here. Selecting a database shows a list of the tables in the database. Finally, clicking a table displays the records of the table:



  • Inspecting preferences

Open the Resources tab of the Developer Tools window and select LocalStorage. You will see the names of the files your app uses to store the preferences. You can even edit the values stored in a file.



  • Inspecting  network connections

If you are using the popular OkHttp library in the 2.2.x+ or 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.

Add dependency

Add Stetho network interceptor into OkHttpClient as follows:

The following is the source code to call the Api.


Open the Network tab of the Developer Tools window, you will see as following result:



To inspect images loaded, you must add Stetho network interceptor into your used image library. In this tutorial, we use Pisasso library for loading images from a server.

Add dependencies

Configure Piscasso library with Stetho

When you load an image from a server, you can see as following



With Stetho library for debugging you can shorten your development time. We tried to be as concise in our tutorial but there are some other  Stetho  features  that are not covered in this tutorial, you can find them here.

I hope you found this tutorial useful, and don’t forget to share it if you liked it.


Source code


Brought to you by the RobustTechHouse team (A top app development company in Singapore).  If you like our articles, please also check out our Facebook page.

Recommended Posts
Contact Us

We look forward to your messages. Please drop us a note for any enquiries and we'll get back to you, asap.

Not readable? Change text. captcha txt