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
in MainActivity.java
and add this line in the method WebView.setWebContentsDebuggingEnabled(true)
.
Here is what my code looks like:
package com.myapp;
import com.facebook.react.ReactActivity;
import android.webkit.WebView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "myapp";
}
@Override
protected void onCreate() {
super.onCreate();
//added this line with necessary imports at the top.
WebView.setWebContentsDebuggingEnabled(true);
}
}
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.