【Tool】前端H5页面Chrome调试

微信页面调试

  1. 打开开发者模式
    进入界面:设置->系统->关于手机
    多次点击版本号。
  2. 开启USB调试
    进入界面:设置->系统->开发人员选项
    • 打开开发者选项
    • 打开USB调试
  3. 打开inspect调试功能
    给【文件传输助手】发送消息: http://debugx5.qq.com
    打开链接,开启【打开TBS内核Inspector调试功能】,如下图所示。
    【Tool】前端H5页面Chrome调试_第1张图片
  4. 连接手机
    进入chrome浏览器,输入网址并打开:
    chrome://inspect/#devices
    点击下面的 inspect 链接即可进入DevTool。
    【Tool】前端H5页面Chrome调试_第2张图片
    【Tool】前端H5页面Chrome调试_第3张图片
  5. 然后就可以调试页面了

app内的H5调试

WebView要开启DEBUG模式

private void enableWebContentsDebug() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        boolean enable = preferences.getBoolean("enablewebcontentdebug", false);
        WebView.setWebContentsDebuggingEnabled(enable);
    }
}

其他步骤同【微信页面调试】

你可能感兴趣的:(JavaScript,Tool)