New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 620032 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Aug 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 617657



Sign in to add a comment

Add Stetho to on Android for Easier UI inspection and Rhino console

Project Member Reported by agrieve@chromium.org, Jun 14 2016

Issue description

http://facebook.github.io/stetho/

I played with this in a stand-alone demo app (https://github.com/agrieve/AndroidMultiProcessPlayground) and found it to be really handy!

Idea would be to just compile this in by default for is_debug=true, and never in release.
 
Cc: tedc...@chromium.org
Owner: zpeng@chromium.org
Felix - feel like taking this on?

v1 would be with no rhino, but certainly there's immense value on adding rhino afterwards as well.

Comment 4 by zpeng@chromium.org, Dec 22 2016

Update:
So far we can hook in Stetho; however, the database inspection feature is not working.
The untested hypothesis is that we need to initialize Stetho with a customized DatabaseFilesProvider that can correctly locate the database files inside chrome.
See DefaultDatabaseFilesProvider and SqliteDatabaseDriver
https://github.com/facebook/stetho/blob/36aa5bd356d9cf5893b9424b06a83dda9ec5e44f/stetho/src/main/java/com/facebook/stetho/inspector/database/DefaultDatabaseFilesProvider.java
https://github.com/facebook/stetho/blob/36aa5bd356d9cf5893b9424b06a83dda9ec5e44f/stetho/src/main/java/com/facebook/stetho/inspector/database/SqliteDatabaseDriver.java

Also, for levelDb support, see https://github.com/facebook/stetho/issues/309

Comment 6 by zpeng@chromium.org, Jan 24 2017

Cc: zpeng@chromium.org
Owner: ----
Status: Available (was: Assigned)
Short summary of progress:
Stetho & Stetho's Rhino module can be integrated into clank's dev build, using build structure similar to LeakCanary https://cs.chromium.org/chromium/src/third_party/leakcanary/BUILD.gn?sq=package:chromium&dr

However, Stetho & Stetho's Rhino module should be not checked into third_party/ due to patent restrictions in its licensing. We need to instruct developers to acquire Stetho, Stetho's Rhino module, and Rhino themselves.

For Mozilla's Rhino to work in our tool chain, we need to specify include_java_resources flag for Rhino's jar, as it contains resources.

Rhino integration works. For example, we can use
org.chromium.chrome.browser.preferences.ChromePreferenceManager.getInstance(null) to update preferences, and changes can be verified. Similar singletons can be found via code search pattern:
getinstance file:java -file:third_party -file:test

Because we cannot check in Stetho and related libs into third_party/, the integration would come at a greater cost. We need to investigate whether Stetho & Rhino is worthy.
One more update on my thoughts on this:
HierarchyViewer exists, and it's likely that Android Studio will make improvements to it.
Stetho's Rhino integration is mainly just the devtools glue. We could probably enable a rhino via telnet bridge fairly easily without the need for stetho if we think this is the main value add.
Status: Archived (was: Available)

Sign in to add a comment