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


JetBrains Improves Kubernetes Support In IDE Upgrades
12/11/2024

JetBrains has improved its IDEs with features to suggest the logical structure of code, to streamline the debugging experience for Kubernetes applications, and provide comprehensive cluster-wide Kuber [ ... ]



Firefox 1.0 Released 20 Years Ago
10/11/2024

A news item with the headline "Firefox browser takes on Microsoft" from 20 years ago has attracted renewed attention. It was originally published on the BBC News website on November 9th, 2004 rec [ ... ]


More News

 

espbook

 

Comments




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

Last Updated ( Thursday, 19 February 2015 )