android - 使用 WebView/GapDebug 调试 PhoneGap 应用程序

标签 android cordova google-chrome debugging webview

我正在开发我的第一个 phonegap 应用程序。在深入开发之前,我真的很想创建一个调试环境。以下是我目前通过网络研究和一整天的尝试得到的结果。

社区推荐了很多工具,但我最终选择了 Chrome WebView 和 GapDebug。现在我可以使用USB 调试

连接到系统

我正在使用 PhoneGap Developer App 从我的 Android 设备连接本地服务器,它工作正常。但我的问题是,当我检查 chrome://inspect 时,它确实列出了设备。但是没有列出用于调试的应用程序。

这是来自 chrome 的屏幕截图。 enter image description here

此处在应用程序运行时不显示任何应用程序。

这里是GapDebug的截图 enter image description here

和 PhoneGap 服务器

enter image description here

我正在使用 192.168.137.1:3000 连接应用 我已经在 chrome Port forwarding settingsGapDebug proxy setting 中添加了这个但是没有成功。

根据 GapDebug 的文档,我在 config.xml 中设置了以下内容

<gap:config-file platform="android" parent="/manifest">
 <application android:debuggable="true" />
</gap:config-file>

并添加了 android:debuggable="true"<application> AndroidManifest.xml 中的元素。

谁能建议我如何让调试工具正常工作。

谢谢。

最佳答案

您无法调试 phonegap 开发者应用,因为它是从 google play 下载的签名应用。您必须在设备上运行您的应用

试试这个命令,它应该可以运行你的应用

phonegap run android --device

或者这个

phonegap cordova run android --device

关于android - 使用 WebView/GapDebug 调试 PhoneGap 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34706922/

相关文章:

java - 构建正则表达式

cordova - CouchDB 作为 Cordova/Phonegap 数据库

facebook - 我可以将JavaScript facebook SDK用于phonegap应用程序吗?

javascript - 如何从 div 元素的 ID 获取 Leaflet map 的 map 对象?

javascript - 未找到文件 - 文件系统 API、Javascript

android - build.gradle中的字符串资源

android - 如何找到我的 Adyen 代币?

android - 在 Eclipse 上通过缓冲区使用 AudioTrack 缓冲区播放音乐 - 没有声音

cordova - 云连接器无法在设备上加载 JSON 数据

html - Opera 和 Google Chrome 中无序列表中的垂直对齐图像