简体   繁体   English

使用Android 4.1.2在模拟器中调试Cordova应用

[英]Debug cordova app in emulator with android 4.1.2

I'm creating cordova application which generally works except one case: when run on android 4.1.2 (and maybe older too) it doesn't communicate with the web-service when authentication is performed with use of certificate. 我正在创建通常仅在一种情况下可以工作的cordova应用程序:当在android 4.1.2上运行时(甚至可能更旧),当使用证书执行身份验证时,它不会与网络服务通信。

It works perfectly on devices and emulator with at least android 4.4 or 5.0.1. 它在至少具有Android 4.4或5.0.1的设备和模拟器上完美运行。

I would like to debug the problem, but chrome inspect does not connect to the app (the 4.4 version of android and newer allows that) started on the emulator. 我想调试问题,但是chrome inspect无法连接到在模拟器上启动的应用(4.4版的android和更高版本允许该应用)。

Unfortunately I have no access to device with android 4.1.2. 不幸的是,我无法使用android 4.1.2访问设备。 I read about possibility of running chromium (see: https://paul.kinlan.me/installing-chrome-for-android-on-an-emulator/ ) but my app is running via WebView. 我阅读了运行铬的可能性(请参阅: https : //paul.kinlan.me/installing-chrome-for-android-on-an-emulator/ ),但我的应用程序是通过WebView运行的。

Is it possible to start my app with use of chromium? 可以使用铬启动我的应用程序吗? Or is there another way to debug my app with use of chrome inspector or anything else? 还是有其他方法可以使用chrome inspector或其他工具来调试我的应用?

Thanks and regards 谢谢并恭祝安康

Ok, I've found a way to do this. 好的,我找到了一种方法。 With adb it is possible to read log generated on the device. 使用adb ,可以读取设备上生成的日志。 So, essentially I will use javascript console.log() to print debug messages to the log and then adb logcat to show them (better useage: adb logcat | grep D/CordovaLog in order to filter out unnecessary records). 因此,从本质console.log() ,我将使用javascript console.log()将调试消息打印到日志,然后使用adb logcat显示调试消息(更好的用法: adb logcat | grep D/CordovaLog以便过滤掉不必要的记录)。

However, maybe there is a better way? 但是,也许有更好的方法? Any help would be appreciated. 任何帮助,将不胜感激。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM