How can I do debug/inspect element of apk webview.
I have tried this but it is helpful only for chrome not for apk.
Please suggest me
How can I do debug/inspect element of apk webview.
I have tried this but it is helpful only for chrome not for apk.
Please suggest me
This is what worked for me, override the method
onCreate
inMainActivity.java
and add this line in the methodWebView.setWebContentsDebuggingEnabled(true)
.Here is what my code looks like:
Build your code, open your app in phone and go to chrome://inspect , You would see your app listed over there. Click on inspect link.
Try this:
Add this line in your custom Application class or in the Activity where the Web View is loaded
// if your build is in debug mode, enable inspecting of web views
Open Chrome and type
chrome://inspect/#devices
and you should see your device in the Remote Target ListHappy coding..
If what you are looking for is a way to turn on WebView debugging for an app that you don't have the source code to, this can be done but you will need to decompile and recompile the app.
The instructions on how to do this can he found here: https://blog.speedfox.co.uk/articles/1524219174-Android_WebView_Hackery
To debug webviews in the android app, you have to set WebView.setWebContentsDebuggingEnabled(true) in the WebviewActivity
Open chrome://inspect/#device to debug. Use port forwarding. Hope this helps! https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews
In react-native-webview they give an explanation for both IOS and Android.
https://github.com/react-native-community/react-native-webview/blob/master/docs/Debugging.md
Helped me on IOS.
I have see there is a chapter for webView.Have you try out? https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews
Seems it need:
An Android device or emulator running Android 4.4 or later, with USB debugging enabled as described in 2. Enable USB debugging on your device .
Chrome 30 or later.