Javascript的执行console.log()在HTC的Andr​​oid设备和亚行logcat [英] Javascript console.log() on HTC Android devices and adb logcat

查看:140
本文介绍了Javascript的执行console.log()在HTC的Andr​​oid设备和亚行logcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发HTML中的应用程序,它被调用的console.log()从Javascript约在网页$ C发生的事情的发展过程中为我提供日志$ C。

I am developing the application in HTML which is calling the console.log() from Javascript to provide me logs during the development about what happens in the web page code.

不幸的是,当我使用亚行logcat 命令检查日志,我可以看到输出的所有其他应用程序,而不是从我的JavaScript code的输出。我可以在Web浏览器中执行我的JavaScript code看到连日志从Web浏览器的页面加载,而不是的console.log()输出。

Unfortunately when I use the adb logcat command to check logs I can see output from all other applications, but not the output from my JavaScript code. I can see even the log from web browser that the page is loaded, but not console.log() output from my JavaScript code executed in the web browser.

据有关此页面(http://developer.android.com/guide/的webapps / debugging.html)它应该工作。

According to information on this page (http://developer.android.com/guide/webapps/debugging.html) it should work.

我正在测试上的 HTC野火 HTC Desire HD的的。

后,更多的则6个月编辑

在一定的时间和经验,在不同的设备(手机,电视,机顶盒,WebViews,UIWebViews ......)我的建议是从JavaScript执行远程登录并不能依靠< STRONG>的console.log()或其他方法 - 看看漂亮的把戏与图像加载<一个href="http://stackoverflow.com/questions/8296079/javaacript-ajax-remote-logger/8296165#8296165">here.

After some time and experience with different devices (phones, TVs, set top boxes, WebViews, UIWebViews...) my advice is to do the remote logging from JavaScript and not relying on the console.log() or other methods - see the nice trick with the image loading here.

千万不要错过presentation 这里 希望这可以帮助! 斯登

Do not miss the presentation here Hope this helps! STeN

推荐答案

在Android上2.3.3(从那时起presumably)默认的浏览器,你可以简单地使用内置的JavaScript控制台:

In the default browser on Android 2.3.3 (and presumably from then on) you can simply use the built in javascript console:

  • 打开浏览器
  • 进入到您的网页
  • 键入有关:调试在地址栏并回车
  • 您会看到一个部分调试选项出现,如果你去到浏览器应用程序的设置
  • 勾选显示JavaScript控制台如果尚未启用
  • 刷新你的网页
  • open the browser
  • go to your webpage
  • type about:debug in the address bar and hit enter
  • you'll see a section for debug options appear if you go into the browser app's settings
  • tick "Show JavaScript Console" if not already enabled
  • refresh your webpage

在顶部,你会看到一个栏标有JavaScript控制台。

At the top, you'll see a bar labeled "JavaScript Console".

这篇关于Javascript的执行console.log()在HTC的Andr​​oid设备和亚行logcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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