如何在PhoneGap应用程序中使用Eclipse和HTC Desire HD显示console.log()输出? [英] How to display console.log() output in PhoneGap app using Eclipse and HTC Desire HD?

查看:137
本文介绍了如何在PhoneGap应用程序中使用Eclipse和HTC Desire HD显示console.log()输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发PhoneGap webapp,在那里我使用一些javascript,有时我需要看到console.log()输出。在Chrome中运行时,我可以很容易地看到它,当在Android模拟器中运行此应用程序时,它也可以正常运行 - console.log()的输出显示在Eclipse LogCat窗口中。但是当我在HTC Desire HD上运行这个应用程序时,LogCat只显示一些Android特定的输出,但是没有来自我的webapp。任何人都有想法如何显示在HTC Desire HD上运行的PhoneGap-app的console.log()输出?

解决方案

请参阅PhoneGap邮件列表线程。另外,两个stackoverflow线程此处其中



似乎在运行Android 2.2的HTC设备上禁用console.log。



我发现最好的解决方法是使用 weinre ,它拦截console.log以显示其桌面浏览器控制台中的输出。



更新:PhoneGap 1.3。 0现在支持console.log直接从HTC Evo的LogCat没有任何解决方法。 (同一程序不适用于PhoneGap 1.1.0)


I am developing PhoneGap webapp where I use some javascript, and sometimes I need to see console.log() output. I can easily see it when running in Chrome, it also works fine, when running this app in Android emulator - output of console.log() shows up in Eclipse LogCat window. But when I run this app on my HTC Desire HD, LogCat just shows some Android-specific output, but nothing coming from my webapp.

Anybody has idea how to display console.log() output from PhoneGap-app running on HTC Desire HD ?

解决方案

See the PhoneGap mail list thread. Also, two stackoverflow threads here and here.

It seems that console.log is disabled on HTC devices running Android 2.2.

The best workaround I've found is to use weinre, which intercepts the console.log to show the output in its desktop browser console.

Update: PhoneGap 1.3.0 now supports console.log directly to LogCat from the HTC Evo without any workarounds. (The same program doesn't work with PhoneGap 1.1.0)

这篇关于如何在PhoneGap应用程序中使用Eclipse和HTC Desire HD显示console.log()输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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