+ 2

Any way to debug JavaScript by stepping line-by-line on mobile phone?

I mean... (1) on device, ie. on the phone, not on desktop, (2) an app or workaround instead of manually inserting console.log(), alert() etc. (3) without a live connection to a desktop computer. I only found apps that print the final output or generic errors, not specifying where was the error generated.

6th Mar 2020, 5:34 AM
Prof. Dr. Zoltán Vass
8 Respostas
6th Mar 2020, 5:59 AM
Tibor Santa
Tibor Santa - avatar
+ 2
Use Chrome devTools, add debugger statement for break points or set breakpoints from devTools. More info please check https://developers.google.com/web/tools/chrome-devtools/javascript/breakpoints Chrome devTools can be used on mobile webpage debugging too. Please check it out https://developers.google.com/web/tools/chrome-devtools/remote-debugging
6th Mar 2020, 9:03 AM
Calviղ
Calviղ - avatar
+ 2
https://jsbin.com/help/features/ jsbin seems to have some sort of debug feature but I am not sure how it works.
11th Mar 2020, 6:56 AM
Tibor Santa
Tibor Santa - avatar
+ 1
Thanks for the article. Unfortunately, this method requires inserting a script in the html every time before debugging. Tibor Santa
6th Mar 2020, 7:38 AM
Prof. Dr. Zoltán Vass
+ 1
Finally I’ve found an interesting mobile console that executes commands and gives feedback: https://jsconsole.com/ Session ID can also be used on desktop computer: https://coderwall.com/p/cvstug/debugging-javascript-errors-on-ios-android-and-other-mobile-devices https://youtu.be/Y219Ziuipvc
6th Mar 2020, 1:21 PM
Prof. Dr. Zoltán Vass
+ 1
FYI: After trying jsconsole.com on mobile,I am disappointed with it. 1. It is not responsive enough (you have to zoom and scroll after each running session). 2. It doesn’t accept the quotation mark (“ or ‘) from my mobile keyboard at all and stops running. It should be automatically recognized and replaced with " which is not built in my mobile keyboard (I can only copy and paste it from the web). Apps like JS Console Run does this replace (despite of other missing features). So if anyone knows a solution for mobile js debugging on device, without another computer please post it!
11th Mar 2020, 6:36 AM
Prof. Dr. Zoltán Vass
+ 1
Tibor Santa I tried it and at first sight it seems to run smoothly on mobile. I’ll test it in the following days more thoroughly. Thanks, Tibor!! Have a great day!
11th Mar 2020, 7:18 AM
Prof. Dr. Zoltán Vass
0
Calviղ Thanks for the idea and links! Specifically, I’m looking for any way to debug ON DEVICE, ie. on the phone itself, not on a desktop computer.
6th Mar 2020, 12:54 PM
Prof. Dr. Zoltán Vass