如何显示使用Eclipse和HTC Desire HD的执行console.log()输出PhoneGap的应用程序?应用程序、Desire、HTC、Eclipse

2023-09-12 07:15:56 作者:印画少年

我的PhoneGap开发web应用程序,我用一些javascript,有时我需要看到的console.log()输出。的console.log输出()显示在Eclipse的LogCat中的窗口 - 我可以在Chrome浏览器中运行时很容易看到它,它也运行此应用程序在Android模拟器时工作正常。但是,当我在我的HTC Desire HD运行这个程序,LogCat中只显示了一些Android的特定的输出,但没有从我的web应用程序的到来。

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.

任何人有想法如何显示的console.log()从PhoneGap的应用程序内的输出上的HTC Desire HD运行?

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

推荐答案

查看PhoneGap的邮件列表中的发。此外,两个计算器线程here和here.

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

看来的console.log处于关闭状态,运行的是Android 2.2的HTC设备。

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

我已经找到了最好的解决方法是使用 weinre ,该截获的console.log显示输出在桌面浏览器的控制台。

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

更新:PhoneGap的1.3.0现在直接支持的console.log到LogCat中的宏达电Evo没有任何解决方法。 (同样的程序不与PhoneGap的1.1.0工作)

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)