我正在使用三星Galaxy S2版本2.3.3,我在Android默认的网页浏览器中打开一个网页。
在页面我把console.log(“一些信息”)debugging页面,但我无法看到console.log输出在我的device.Please帮我在这个。感谢提前。
尝试使用JSConsole.com 。 这是一个JavaScript的远程debugging器。 设置基本上只是在你的页面注入一个<script>
标签。 连接后,您可以从JSConsole的远程页面读取所有console.log
调用,以及在客户端执行命令。
:listen
。 <script src="http://jsconsole.com/remote.js?..."></script>
。 console.log
调用将被转发到JSConsole.com窗口。 在远程debugging页面上有更多的细节和一些有用的video。
有两种方法我们可以看到console.log消息
方法1:
在远程使用WEINRE远程WEb Inspector。 它是一个nodejs包。 安装WEINRE的步骤
npm install -g weinre
(for MAC sudo npm install -g weinre
) weinre --boundHost -all- --httpPort 8082
,这里的8082是WEINRE启动的端口号。 <script src="http://xx.xx.xx.xx:8082/target/target-script-min.js#weinredemo"></script>
xx.xx.xx.xx
是您机器的IP地址。 weinredemo
是你的页面的ID,你可以使用我们自己的任何一个。 http://localhost:8082/client/#weinredemo
方法2: