Kesty
Kesty

Reputation: 620

Chrome Inspector shows Android Webview in AVD but not on actual device

I have an Android app with a WebView which shows a simple web page. If I run the app in Android Studio's AVD (virtual device), I can inspect the WebView in Chrome Inspector. However, if I run the app on my device, I can't see the WebView. I can see Facebook (com.facebook.katana) and I can see all my Chrome tabs, but the WebView is missing.

In the past, I have been able to see the WebView on my device as well but this stopped working a few weeks ago. (Developer tools are active and USB debugging is active)

Can anyone help me figure out why the WebView is not inspectable in Chrome Inspector?

Upvotes: 7

Views: 5643

Answers (2)

Tim Boland
Tim Boland

Reputation: 1972

For me...the DeVTools window is blank...ive tried this for both our app and viewing Chrome through the devive

Upvotes: 0

Mikhail Naganov
Mikhail Naganov

Reputation: 6871

Make sure you are calling WebView.setWebContentsDebuggingEnabled(true); in your application (see https://developer.chrome.com/devtools/docs/remote-debugging#configure-webview for full info). AVD runs a "debug" Android image, where debugging of WebViews is enabled by default. On regular (so called "user") images you need to have it enabled by your app.

Another point to consider is that you need to create at least one WebView instance in order to see your app listed in chrome://inspect.

Upvotes: 7

Related Questions