|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.
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
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:
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.
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.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Thursday, 19 February 2015 )|