explorers' club

explorations in dev, science, sci-fi, games, and other fun stuff!

Connect Debugger to manually Deployed debug.swf

3 Comments

Have you ever tried to manually launch a debug.swf in your browser and got the “connect to debugger where? localHost or remote” dialog box?.

Here is a scenario:

You have a flex application that has some service deployment dependencies on the server it is deployed on.  In plain English this means that in order for your application to work, it has to be on a server with specific technologies such as (dot)NET.  Well normally you would set up the deployment location in the “flex build path” and “flex server” tabs under the project’s properties.  Sometimes that won’t do.  What if you are working remotely?  What if you VPN is extremely slow?  What if the FileSync plug-in just takes too damn long to sync ONE file. This is my setup in a nutshell for the current project I am on (which I telecommute and use a high-encryption VPN client).  In fact to deploy to a dev server takes me over 5 minutes for one build.  Why?  That is a topic still being investigated currently as I write this.

So rather than have to do a lengthy build, I can build to my local bin folder (which takes about 10 seconds), copy over to the the dev server folder manually using the old ctrl-c, ctrl-p method, and then launch the debugger version’s URL manually.

Here’s how:

  1. Edit the “Output folder URL” under the “flex build path” tab in the project’s properties.  I used http://www.google.com since about:blank doesn’t seem to work.
  2. Keep the”Output folder” the same as you would normally have it.
  3. Do a build of the debugger version.
  4. It will then try to launch the browser to the url specified in step 1.  This will say it can’t find that file.
  5. Copy and Paste the version of the debug.swf where you want it to launch from on the remote location (hopefully taking only a few seconds at most).
  6. Launch the correct URL pointing to the debug.swf now deployed in the right place.

This works because the Flex Builder debugger retains its connection for about 2 minutes after you build  a debug.swf.  So by launching the fake location, you open the socket, then you can connect a remotely deployed debug.swf up to the debugger.

Thanks goes to Mike Morearty at Adobe for the inside tip.  I think this will help alot of folks.  You can read the original dialog I had with Mike (and read my idiotic reply, wtf justin, must have been tired or lazy or both?) at flex coders on a related post.

Advertisements

3 thoughts on “Connect Debugger to manually Deployed debug.swf

  1. This one can be handy in debugging when SWF file was deployed at remote server…

    Bookmarked at Del.icio.us, thanks!

  2. This solution in fact a great solution for me. Right on! 🙂

    Thanks,

    -Max-

  3. As by your request, I’ll mention here that when you create a swf-file using the haxe compiler (and by that using the haxe-language), you can pass the flags

    -D fdb -debug

    to the haxe compiler to get the swf working with the Flash Builder profiler/debugger.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s