Skip to content
Josh Guilfoyle edited this page Jun 7, 2016 · 2 revisions

General issues

Nothing is shown in Chrome DevTools and I see many "Method not implemented" messages in logcat

If you the Chrome DevTools doesn't appear to have any functionality, and logcat shows a large amount of message spam such as:

D/ChromeDevtoolsServer﹕ Method not implemented: Not implemented: Page.canScreencast
D/ChromeDevtoolsServer﹕ Method not implemented: Not implemented: Page.canEmulate
D/ChromeDevtoolsServer﹕ Method not implemented: Not implemented: Worker.canInspectWorkers
D/ChromeDevtoolsServer﹕ Method not implemented: Not implemented: Console.setTracingBasedTimeline
D/ChromeDevtoolsServer﹕ Method not implemented: Not implemented: Console.enable
D/ChromeDevtoolsServer﹕ Method not implemented: Not implemented: Network.enable

Then you may need to modify your proguard rules to not name mangle certain Stetho classes whose names map directly to the client/server protocol spoken by Stetho. Edit proguard-rules.pro as follows:

-keep class com.facebook.stetho.** {
  *;
}

How can I include Stetho only in release builds?

See http://www.littlerobots.nl/blog/stetho-for-android-debug-builds-only/ for our recommended approach. This approach is also used by stetho-sample.

Network tab

Network traffic doesn't appear with OkHttp even though I'm using StethoInterceptor

If no network traffic appears, it's likely that you are inadvertently using the legacy compatibility layer called OkUrlFactory. Older versions of Picasso (<= 2.4), Retrofit (<= 1.8), etc use this to have a common HttpUrlConnection code path. If you are using one of these older libraries, the easiest thing to do is to upgrade to the latest.

I'm using OkHttp and only some of my network traffic shows up

This is commonly caused by having multiple OkHttpClient instances in the application. Only those applications which have had StethoInterceptor installed will work properly. If you are using a third-party library such as Picasso or Retrofit, consult the initialization API to find out how to pass your specific OkHttpClient instance to them.

I'm using Volley, how can I integrate the network tab?

If you use Volley with OkHttp, we recommend OkHttpStack.

If you are using the default HurlStack implementation, you will likely want to use com.facebook.stetho:stetho-urlconnection to hook into it from a custom subclass. This pull request tracks our progress providing a more generic and re-usable wrapper however: #51.

I'm using HttpURLConnection, how can I integrate the network tab?

The stetho-sample in the source provides a good example of how this can be done. Specifically, see the Networker class. This uses the com.facebook.stetho:stetho-urlconnection dependency in Maven/Gradle.

Elements tab / View hierarchy

How do I jump to a specific View in the hierarchy?

There is a small magnifying glass icon in the upper left of the Chrome DevTools UI (to the left of the "Elements" tab itself). Click it, which will cause it to turn blue. Then tap on the view you're interested in on your phone/emulator. The view should now be selected in the Elements tab.

If the wrong view is selected, this is likely due to a heuristic error on our part. Please file an issue and we'll be happy to look into what we can do to improve the algorithm.