Facebook's Stetho For Android Debugging
Written by Alex Armstrong   
Thursday, 19 February 2015

Facebook has released an open source tool for debugging Android code. Described as a debug bridge, Stetho gives developers access to the Chrome Developer tools.

stethoban

Introducing Stetho,  on the Facebook engineering blog, Josh Guilfoyle explains:the rational for introducing a new platform that gives Android devs access to debugging tools that allow them richer and more convenient access to data: 

Part of moving fast at Facebook means investing in good tooling. At our scale, we aim to have tools that let engineers not only quickly discover problems and fix them, but also help model behavior to move efficiently through a large code base. Lack of a solution for this need led us, like a lot of other Android developers, to a fair number of inconsistently maintained internal UIs, circumstantial and hard-to-interpret Log statements, not to mention many painful sessions with the Java debugger.

Not only is Stetho inspired by Chrome Developer Tools, it uses Chrome Develop Tools to serve the UI. Notice that Stetho is a debugger for Android apps not HTML/Web apps.  To include it you simply add a line to the onCreate event handler that initializes Stetho. If you want additional features such as network inspection then you have to include more code at relevant locations.

Integration with the Chrome DevTools frontend is implemented using a client/server protocol which the Stetho software provides for your application. Once your application is integrated, simply navigate to chrome://inspect and click "Inspect" to get started:

stetho1

 

This allows you, for example, to use the  full spectrum of Chrome Developer Tools features for network inspection, including image preview, JSON response helpers, and even exporting traces to the HAR format:

stethonetworkins

Stetho also provides a command-line interface to app internals with its dumpapp tool. This goes beyond the DevTools UI features to give more extensible facilities and if the plugin you want isn't in its default set you can, of course, write create your own.

stethodumpapp

In the blog post Josh Guilfoyle  promises more saying:

We are releasing early with a few features still missing, but we are hard at work on expanding the library. Stetho is our first Android open source project in 2015, and we are excited to get early feedback on our GitHub page .

You can download Stetho from GitHub or alternatively include Stetho from Maven Central via Gradle or Maven.

 

stethosq

Banner


Windows 11 Adoption Takes A Downturn
11/12/2024

With Windows 10 End of Life only ten months away, Microsoft is stepping up its campaign to get Windows users to upgrade to Windows 11. But while Windows 11 had been gaining users at a steady rate at t [ ... ]



Flutter 3.27 Improves Cupertino Widgets
03/01/2025

Flutter 3.27 has been released with updates to the framework, engine, and ecosystem, including progress with Impeller and improvements to Cupertino widgets. The new version also has new features in De [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 19 February 2015 )