Cordova App中的调试崩溃 [英] Debugging crash in Cordova App
问题描述
我目前正在开发基于Cordova/AngularJS的跨平台应用程序,该应用程序具有一些第三方插件(主要是蓝牙),并且正在寻找一种方法来调试应用程序的本机Java代码或记录崩溃信息.
I am currently developing a cordova / AngularJS based cross platform app with some third party plugins (mainly Bluetooth) and am looking for a way to debug the native Java code of the app or log crash information.
应用程序通过Cordova在KitKat 4.4.4/三星Galaxy S4上运行android --debug命令
App is running on KitKat 4.4.4 / Samsung Galaxy S4 via cordova run android --debug command
IDE当前是带有Cygwin控制台的NetBeans
IDE is currently NetBeans with Cygwin console
javascript控制台不提供有关崩溃的信息,但与我正在使用的 https://github.com/bcsphere/bluetooth
The javascript console provides no information as to the crash but is clearly tied to the Bluetooth plugin i am using https://github.com/bcsphere/bluetooth
我尝试使用adb logcat命令,但是它似乎只是连续长时间打印出数据,而没有提供任何特别有用的信息.
I have tried using adb logcat command but it seems to just continually print out data for an extended period of time without providing anything particularly useful.
具有Java的基本知识,因此如果可能的话,有兴趣查找导致崩溃的Java错误.任何帮助将不胜感激,谢谢.
Have a basic grasp of Java so would be interested in finding the Java error causing the crash if possible. Any help would be greatly appreciated, thanks.
推荐答案
- 在android设置中启用开发者模式
- 启用USB调试
- 通过USB将设备插入计算机
- 在终端中运行:adb logcat
- 在手机中运行该应用程序,adb logcat将为您提供Java崩溃报告
查看您要执行的操作:
adb logcat | grep -i "nameofyourapp"
它将过滤日志的行
这篇关于Cordova App中的调试崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!