如何使用Eclipse和HTC Desire HD在PhoneGap应用程序中显示console.log()输出?

时间:2022-10-22 16:58:19

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.

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

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

有人知道如何显示在HTC Desire HD上运行的PhoneGap-app的console.log()输出吗?

4 个解决方案

#1


19  

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

请参阅PhoneGap邮件列表主题。此外,这里和这里有两个*线程。

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

似乎在运行Android 2.2的HTC设备上禁用了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.

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

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 1.3.0现在支持console.log直接从HTC Evo到LogCat,无需任何解决方法。 (同一程序不适用于PhoneGap 1.1.0)

#2


31  

Another workaround is to use console.log() jsconsole.com

另一种解决方法是使用console.log()jsconsole.com

#3


0  

I've found that console.error gets higher priority than console.log , and appears in the adb logcat output for both emulator devices and real devices connected via USB.

我发现console.error的优先级高于console.log,并且出现在adb logcat输出中,用于仿真器设备和通过USB连接的真实设备。

#4


-2  

Try this filter:

试试这个过滤器:

adb logcat PhoneGapLog:V *:S

adb logcat PhoneGapLog:V *:S

It will only show console.log and phonegap specific output.

它只显示console.log和phonegap特定输出。

#1


19  

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

请参阅PhoneGap邮件列表主题。此外,这里和这里有两个*线程。

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

似乎在运行Android 2.2的HTC设备上禁用了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.

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

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 1.3.0现在支持console.log直接从HTC Evo到LogCat,无需任何解决方法。 (同一程序不适用于PhoneGap 1.1.0)

#2


31  

Another workaround is to use console.log() jsconsole.com

另一种解决方法是使用console.log()jsconsole.com

#3


0  

I've found that console.error gets higher priority than console.log , and appears in the adb logcat output for both emulator devices and real devices connected via USB.

我发现console.error的优先级高于console.log,并且出现在adb logcat输出中,用于仿真器设备和通过USB连接的真实设备。

#4


-2  

Try this filter:

试试这个过滤器:

adb logcat PhoneGapLog:V *:S

adb logcat PhoneGapLog:V *:S

It will only show console.log and phonegap specific output.

它只显示console.log和phonegap特定输出。