我在做一个和拉斐尔有关的项目。事实证明,它在Android上不起作用。iPhone上是这样的。

我该怎么调试Android浏览器上的东西呢?它是WebKit,所以如果我知道版本,在完整版本的WebKit上调试它会产生相同的结果吗?


当前回答

如果您正在寻找非远程选项:

在早期和非根的Jellybean版本中,如果android.permission. logcat viewer可以使用。READL_LOGS通过adb授权一次。

在firefox上,有一个控制台插件可以读取并显示所有应用程序日志,还有firebug lite。

其他回答

看一看jsHybugger。它将允许你远程调试你的js代码:

Android混合应用(webview, phonegap, worklight) Web页面运行在默认的android浏览器(不是Chrome,它支持ADB扩展没有这个工具)

这是如何工作的(在项目网站上有更多的细节和替代方案,这是我发现的最好的方法)。

Install the jsHybugger APK on your device Enable USB debugging on you device. Plug the Android device into your desktop computer via USB Run the app on the Android device ('jsHybugger') Enter the target URL and page in the app. Press Start Service and finally Open Browser You'll be presented with a list of installed browsers, choose one. The browser launches. Back on your desktop computer open Chrome to chrome://inspect/ An inspectors window will appear with the chrome debugging tools linked to the page on the Android device. debug away!

同样,在Android上使用Chrome使用ADB扩展而不使用jsHybugger。我想这个问题的公认答案已经描述过了。

Chrome有一个很棒的功能,可以简单地将实际的Android Chrome内容(包括检查等)显示到PC屏幕上…

在设备上打开USB调试,也许你还需要通过adb设备连接一次,以触发移动设备上的“允许与…通信”对话框, 将Android设备连接到PC上, 在两者上启动Chrome,然后 然后浏览chrome://inspect/# PC上的设备。 这里列出了来自手机Chrome的标签,可以检查。

网上也有详细的手册:https://www.till.net/technologie/html-javascript/remote-web-debugging-unter-android-und-chrome

(发现adb logcat在浏览器中什么都没有显示)

试试“vconsole”,也许能帮到你

Android 5.1.1上Galaxy S6上的Android本机浏览器的全Chrome远程调试:

开启手机USB调试(设置,关于,快速点击版本号,开发人员设置,USB调试) 打开“网络” 导航到“about:debug”(你会看到一个错误) MORE菜单>设置>调试>远程调试 用USB数据线连接手机和电脑 在手机上,在Internet web浏览器中,打开要调试的站点 在电脑上打开Chrome 导航到'chrome://inspect' 单击要检查的浏览器选项卡上的“检查”

Galaxy S5设备可以在Chrome浏览器中显示,但标签页只有在重启后才能显示。重新启动并尝试连接后,移动浏览器崩溃。

没有人提到liriliri/eruda,它为移动网站/应用程序添加了自己的调试工具

将此添加到您的页面:

<script src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>

将在打开控制台的页面中添加一个浮动图标。