Hacker News new | ask | show | jobs
by tarnic 4144 days ago
Looks cool! But wait: does it mean that we have to add this instrumentation code when debugging, but when releasing to the Play Store, we have to remember to remove it? Or does it work only when the app is not signed and you can attach the debugger?
1 comments

Currently our recommendation is to use an if (DEBUG) block around your initialization and then use proguard to remove the dead code in release. We are working on a better solution which allows you to use build flavors in gradle. The proguard solution is how Facebook apps strip it out today, however.

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.