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


Remembering Thomas Kurtz, Co-creator of BASIC
15/11/2024

Thomas Eugene Kurtz, the co-founder of the BASIC programming language, has died at the age of 96. BASIC, which was developed for the purpose of education, popularized computer programming making it ac [ ... ]



The Feds Want Us To Move On From C/C++
13/11/2024

The clamour for safe programming languages seems to be growing and becoming official. We have known for a while that C and C++ are dangerous languages so why has it become such an issue now and is it  [ ... ]


More News

 

espbook

 

Comments




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

Last Updated ( Thursday, 19 February 2015 )