android模拟器中的console.log浏览器 [英] console.log browser in android emulator

查看:88
本文介绍了android模拟器中的console.log浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用android模拟器查看网站的console.log消息?

How to see console.log messages of a website using android emulator?

推荐答案

来自Rich Chetwynd的短文《Android浏览器上的Javascript调试》.

From Rich Chetwynd's short article "Javascript debugging on Android browser".

您可以从 Android 设备或模拟器记录 javascript 错误和控制台消息.为此,您首先需要安装 Android SDK 和 USB 驱动程序并在实际设备上启用 USB 调试.

You can log javascript errors and console messages from your Android device or emulator. To do this you first need to install the Android SDK and USB drivers and enable USB debugging on the actual device.

要检查设备是否连接正确,您可以从 Android SDK 工具目录运行以下 cmd,您应该会在列表中看到一个设备

To check if the device is connected correctly you can run the following cmd from your Android SDK tools directory and you should see a device in the list

c:android sdk..platform-toolsadb devices

然后,您可以使用 Android Debug Bridge 过滤调试消息,以便通过运行以下 cmd 仅查看与浏览器相关的消息.

You can then use the Android Debug Bridge to filter debug messages so that you only see browser related messages by running the following cmd.

c:android sdk..platform-toolsadb logcat browser:V *:S

默认情况下,日志会写入标准输出,因此您会看到任何 Javascript 错误或 console.log 消息等写入 cmd 窗口.

By default the log is written to stdout so you will see any Javascript errors or console.log messages etc written to the cmd window.

更多详情:Logcat CLI 工具文档.

这篇关于android模拟器中的console.log浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆