简体   繁体   中英

How to debug JavaScript errors when running a Cordova App on Android TV

I have written a Javascript script which I bundled into an Android app using Cordova. The code is written in ES6 and is transpiled into ES5 using Babel and Webpack.

The app is intended to run on a simple TV, so I am using MK809 Android dongle to transform a TV into an Android-based TV. Then I install the new app and try to run it.

The problem is that the app terminates immediately (most probably due to some ES5 errors as the transpilation is probaby not complete or correct).

Is there a way this can be debugged? When I run it on my computer's Chome, everything works perfectly as it has full ES6 support. The app also runs perfectly on my Android phone as it uses a modern browser which supports ES6.

I am not a FE guy, so my knowledge is a bit limited. Can anyone suggest the best way to debug this? How can I run a local copy of a brower with ES6 disabled so that I could easily spot the problem?

Thank you

The only I see you could achieve this would be to root this Android dongle and install something like ADBWifi so you can debug it through Chrome/ADB over your local network. This is what I do for ChromeOS devices, not too sure if it's doable with your device...

I found out that using a service like errlog.io gives me what I need. JavaScript errors get captured and sent to the their service and then are accessible on the dashboard

see: Get Started with Remote Debugging Android Devices

the MK809 dongle has an USB port and it would need to have USB debugging enabled.

then go to chrome://inspect on the computer's Chrome, in order to access the debugger.

logging and debugging is something very else; that dongle actually is a Rockchip RK3066 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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