Stetho: A new debugging platform for Android
code.facebook.com
code.facebook.com
I am really impressed by a lot of the Facebook open source releases. Each new one makes me even sadder that you can't use them due to the crazy patent license they've started using:
https://github.com/facebook/stetho/blob/master/PATENTS
"The license granted hereunder will terminate, automatically and without notice, for anyone that makes any claim (including by filing any lawsuit, assertion or other action) alleging [...] that any right in any patent claim of Facebook is invalid or unenforceable."
But then I saw this: http://stks.freshpatents.com/Facebook-Inc-nm1.php
314 patents in 2014, 69 just since the start of 2015. That's... just absurd.
And then you have people that pay money to GitHub for code hosting...
> ... Im sure many people don't want GitHub to start arbitrarily banning projects because of a random set of beliefs they have
It wouldn't be unprecedented and it wouldn't be arbitrary. Google Code, for instance, only allows open source projects to be hosted with them. From what I can tell about Github, they allow any license. Doesn't mean that they can't change that policy.
Sure, it's easier to do nothing. But they alone could do something. And Facebook will get the goodwill they want from this without much kickback because nobody does anything.
For things like the network traffic it is really hard to see request/response for a particular thing.
For the dumpers - those are basically a main method inside your program that you can run whenever. Its a nice way to change (or dump) state of the program, similar to adb shell dumpsys, but also allows a richer interface for changing state.
They've saved me a ton of time. Especially when you're using something like PhoneGap, where you're coding in JS, it's nice to have your old familiar web-based debugging console available.
https://github.com/square/PonyDebugger
I'm sure Facebook was inspired with PonyDebugger to create this.
https://github.com/facebook/stetho/issues/14
Would be really dope if they got that integrated into the elements tab.
This does make me wonder how their HTTP debugging works? I am assuming that data is passed over USB. Are they using ADB underneath this all?
[1]https://github.com/facebook/stetho/blob/master/stetho/src/ma...
[2]https://developer.chrome.com/devtools/docs/remote-debugging
OkHttpClient client = new OkHttpClient();
client.networkInterceptors().add(new StethoInterceptor());That said, it is safe to ship the stetho engine in your release apps and it adds virtually no runtime overhead to initialize due to our deferred init design. For instance, Chrome for Android ships with the same system we have and it is always enabled even for release builds.
See https://github.com/facebook/stetho/issues/16 to track our progress addressing this issue.