Stetho is an open-source library developed by Facebook, and available on GitHub.

1. Installation

Add to your build.gradle file

Now, you must add in your Application object the Stetho initialization:

Then, the last step, add a Stetho listener to your http client (for me it will be okhttp3 )

And that’s all !

2. Use

Plug in your smartphone (with the debugging application) to your computer, 
then open your chrome browser.

In the address bar, enter chrome: // inspect

The name of your device and the application you are debugging should appear:

Click on inspect

Now launch your network calls (from the application, clicking buttons, changing screens etc.) and you should see the frames appear in the Network tab

And you should see one frame per network call!

This tool is super powerful, and allows you to have super readable access to all the data of your calls to your web service, a must to have!

BONUS

We can do a lot more with stetho:

  • Have access to SharedPreferences content
  • Analyze and query SqlLite databases
  • Inspect the hierarchy of views on our screen