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


WasmCon 2023 Sessions Now Online
01/03/2024

The recorded session of the premier conference for technical developers and users interested in exploring the potential of WebAssembly are now online.



Google Releases Gemma Open Models
28/02/2024

Google has released a set of lightweight open models that have been built from the same research and technology used to create Google's recent Gemini models.


More News

 

raspberry pi books

 

Comments




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

Last Updated ( Thursday, 19 February 2015 )