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

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

问题描述

我正在开发 PhoneGap 网络应用程序,其中使用了一些 javascript,有时我需要查看 console.log() 输出.在 Chrome 中运行时我可以很容易地看到它,它也可以正常工作,在 Android 模拟器中运行这个应用程序时 - console.log() 的输出显示在 Eclipse LogCat 窗口中.但是当我在我的 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.

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

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

推荐答案

查看 PhoneGap 邮件列表 线程.此外,还有两个 stackoverflow 线程这里这里.

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

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

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

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

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 直接从 HTC Evo 转换为 LogCat,无需任何解决方法.(相同的程序不适用于 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)

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

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