如何在手机本身上调试phonegap android应用程序

发布于 2024-12-26 16:09:06 字数 280 浏览 0 评论 0原文

我在 Android 手机上使用调试模式时遇到一些问题。我按照说明进行操作:

  1. 在手机中打开调试模式
  2. 设置手机 USB 连接到电脑模式
  3. 安装谷歌 USB 驱动程序
  4. 将 Android 连接到电脑,然后右键单击项目 - >运行为 - > Android 应用程序

这会导致我的模拟器弹出并我的手机上什么也没发生。我在这里可能会缺少什么?

谢谢

编辑:得到它工作伙计们,我安装了 OEM 驱动程序

I'm having some trouble getting debug mode to work on my android phone. I followed the instructions:

  1. turn on debug mode in phone
  2. set phone usb connection to pc mode
  3. install google usb driver
  4. connect android to pc, and then right click project->run as->android app

this results in my emulator popping up and nothing happening on my phone. What could I be missing here?

thanks

EDIT: got it working guys, I installed the OEM driver instead

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

神回复 2025-01-02 16:09:06

回答您的标题:如何在手机本身上调试phonegap android应用程序

您可以使用各种可以为您捕获日志的应用程序。这对调试绝对有帮助。它为您提供相对(选择过滤器或日志模式;详细、调试等)相同的信息,尽管感觉不一样,与下面的调试 PhoneGap 部分一样。

https://market.android.com/search?q=logcat

但是对于 调试 PhoneGap 见下文...

摘自 http://wiki.phonegap.com/w/page/16494774/Getting%20started%20with%20Android%20PhoneGap%20in%20Eclipse

解决方案:
要获取有关 PhoneGap 运行时发生的情况的更多信息,请运行 Android 日志查看器。 adb logcat 如果未找到 adb
你只需要完成它的完整路径就像
~/projects/andriod/android-sdk-mac_86/tools/adb logcat。如果你有
设备和 Android 模拟器都运行使用 -d 和 -e ,如下所示
adb -e logcat。这应该会给你更多关于正在发生的事情的信息
在。这是一个从 android 日志中剪辑的小示例。

D/PhoneGapLog(  291): file:///android_asset/www/phonegap.js: Line 216 : TypeError: Result of expression 'accel' [undefined] is not an object.
E/Web Console(  291): TypeError: Result of expression 'accel' [undefined] is not an object. at file:///android_asset/www/phonegap.js:216
D/dalvikvm(  117): GC_EXPLICIT freed 1727 objects / 91840 bytes in 110ms
D/PhoneGap(  291): The provider network is disabled
D/SntpClient(   61): request time failed: java.net.SocketException: Address family not supported by protocol

从中我们可以看出加速不起作用。以及有关错误位置的一些信息。这有助于调试问题
还可以帮助您在询问 PhoneGap 时提供更多信息
社区寻求帮助。

To answer your title: how to debug phonegap android application on the phone itself

You can use a variety of apps that can capture the log for you. Which are absolutely helpful in debugging. And it gives you relatively (choose your filters or log mode; verbose, debug etc) the same information, although not same feel, as the debugging PhoneGap section below.

https://market.android.com/search?q=logcat

But for debugging PhoneGap see below...

Taken from http://wiki.phonegap.com/w/page/16494774/Getting%20started%20with%20Android%20PhoneGap%20in%20Eclipse

SOLUTION:
To get more information about what is going one while phonegap is running, run the Android log viewer. adb logcat if adb isn't found
you just need to do the full path to it something like
~/projects/andriod/android-sdk-mac_86/tools/adb logcat. If you have
both a device and a Android emulator running use -d and -e like so
adb -e logcat. This should give you more info about what is going
on. Here is a small example clipping form the android logs.

D/PhoneGapLog(  291): file:///android_asset/www/phonegap.js: Line 216 : TypeError: Result of expression 'accel' [undefined] is not an object.
E/Web Console(  291): TypeError: Result of expression 'accel' [undefined] is not an object. at file:///android_asset/www/phonegap.js:216
D/dalvikvm(  117): GC_EXPLICIT freed 1727 objects / 91840 bytes in 110ms
D/PhoneGap(  291): The provider network is disabled
D/SntpClient(   61): request time failed: java.net.SocketException: Address family not supported by protocol

From this we can see that the accel is not working. And some information about the location of the Error. This helps debug problems
and also helps you to give more information when asking the PhoneGap
community for help.

西瑶 2025-01-02 16:09:06

您需要确保手机上启用了 USB 调试。

设置->应用->发展。

这里是此信息的重要来源的链接。

You need to make sure that you have usb-debugging enabled on your phone.

Settings -> Applications -> Development.

Here is link to a great source for this information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文