chrome debug webview in android app

一、android代碼中增長,activity所在的的類java

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    WebView.setWebContentsDebuggingEnabled(true);
}

二、打開chrome調試工具,地址欄輸入:chrome://inspect,而後回車android

三、打開app,進入到webview頁面中,會發現 設備界面web

四、點擊inspect,便可打開調試頁面。 tips:手機必須開啓開發者模式,而且容許debugchrome

相關文章
相關標籤/搜索