Is it possible to have a stepping debugger?

Yeah… I totally understand that is not easy to do. But still, as I’m moving from Pythonista to Scriptable, I really miss the built-in debugger in Pythonista. It provides breakpoints, step over, and object inspector.

Do we have a plan for that? It would push the debugging work to the next level! @simonbs

(sorry if I’m creating duplicated topics, I didn’t find it in the forum)

1 Like

I currently thought a bit about a way to implement this. I don’t know how Pythonista is doing that. My question was, where to display them when a UI is shown?

One way that came to my mind was to implement a WebSocket connection when there is a WiFi connection to a remote PC with for example the chrome debugging protocol (I’ve found this one, but I don’t know if this is the right one).

Another possibility could be to set the breakpoints in the editor view on iOS. And while debugging, the user can shake his device to switch between the displayed UI element and the editor view. Or there is a button floating on the screen that can be dragged around like the iOS accessibility menu button and when tapped displays either a menu or switches to the editor view.

Just some thoughts and a little brainstorming :wink:

My question was, where to display them when a UI is shown?

Pythonista shows a floating panel for that, and you can add/remove breakpoints in the editor view.

I think WebSocket can only provide a logging tool, not a stepping debugger, it could be nice though.

Ah ok, thanks. Probably this is also the best solution.

No. WebSocket is just the protocol for a connection method. You can send whatever information you want with it and it depends on the implementation what the messages do. Everything is possible with that. If you debug for example a Node.js application with the Google chrome devtools, it uses a WebSocket connection.

You can send whatever information you want with it and it depends on the implementation what the messages do

Yeah, I get it. But I still don’t understand how do you implement a breakpoint, do you mind sharing more details? Thanks.

I don’t know how they’ve implemented it. I just knew that the remote debugging was implemented with WebSocket. That’s all.

The specification should be here: https://chromedevtools.github.io/devtools-protocol/

1 Like