PlayBook Remote Debugger

Posted:   |  More posts about ActionScript3 Python debugging

Since I don't have any Flash/Flex development tools other than the freebie command line stuff, I tried using the command line debugger to monitor trace() output in my ActionScript code. It didn't work.

The BlackBerry Development Knowledge Base has an article called Compile and Debug without Flash Builder Using a Command Line which describes how it's supposed to work.

In a nutshell, you compile with -compiler.debug, and package with -target bar-debug -connect [YOUR COMPUTER'S IP ADDRESS]. This sets up the application to connect back to your PC when it runs. Before you launch it, you run fdb locally, then enter the run command. At this point the debugger starts lisening on port 7935 for connections, and you go deploy/launch your app.

At this point, magic things should happen. They don't, at least for me. I'm pretty sure it's an incompatibility between the version of the debug fixture code built into the app and the version of fdb in use. Either way I had no luck, and things would simply stall until the app gave up and continued, while the debugger showed no activity.

So I built my own debugger. Using Python, naturally. It's very crude, but since all I wanted was the equivalent of "print" statements (which in ActionScript3 is your trace() calls), it's Good Enough.

In all it's crude glory then, I present pyfdb and the following instructions for use:

  1. Build your app for debug mode.
  2. Launch the debugger: python
  3. The debugger should print "listening on 7935" (the Flash debug port)
  4. Deploy/launch your app.
  5. The debugger should show interesting things, followed by the output of any trace() statements in your code.

I'm absolutely certain there are many things it could do that it doesn't, not the least of which is sending back from the debugger to the application a bunch of configuration changes that I can see fdb send when I connect to it with telnet.

But it works for me. Released under the Simplified BSD License.

Download it here: pyfdb v0.0

Comments powered by Disqus