Debug Tricks: Remote Debug with Conditional Breakpoints

At some point, you’ve probably hit a bug that you can only reproduce on a remote machine (perhaps a testing/staging or production server). Here are some simple instructions on how to debug your SWF remotely:

  1. Open the Debug Configurations dialog. In the toolbar, click the Debug button and choose Other…. From the menu, choose Run > Debug > Other…
  2. Create a new Debug Configuration for your project. Click the new icon in the top left. Choose your project and the application MXML or ActionScript file.
  3. Specify the URL of your SWF or HTML file. Uncheck “Use Default” under “URL or path to launch”. Enter your URL.
  4. Debug

You can still use all the debug features you would normally use locally. A great trick to demo here is using conditional breakpoints to modify your application at runtime:

  1. Create a breakpoint
  2. Right click on the breakpoint, select Breakpoint Properties
  3. Check enable condition
  4. Enter a valid expression, e.g. this.mySprite.rotationZ += 10
  5. End the expression with: “, false”

Normally you would use conditional breakpoints to suspend when a condition is true. The trick here is that evaluating an expression can have intended/unintended side effects. In this case, we can string together a comma-separated list of expressions and never suspend the application since the expression will always return false.

Share on Facebook