Debugging using the Apollo Debug Launcher
Back to: Apollo Documentation home page
Use the Apollo Debug Launcher (ADL) to run both Flex-based and HTML-based applications during development. Using ADL, you can run an application without first packaging and installing it. If you're developing a Flex-based application, you can also connect to the Flash Debugger (FDB), which allows you to set breakpoints and step through your code. The Apollo runtime does not need to be installed to use ADL (just the Apollo SDK).
To launch an application with ADL:
adl [-runtime <runtime-directory>] <application.xml> [<root-directory>] [-- arguments]-runtime <runtime-directory>: specify the directory containing the Apollo runtime to use. If not specified, the runtime directory in the same SDK as the ADL program will be used. (If ADL is moved out of its SDK folder, then the runtime directory must be specified.)
<application.xml>: the application descriptor file of the application to run.
<root-directory>: the root directory of the application to run. If not specified, the directory containing the application.xml file is used.
-- arguments: any character strings appearing after "--" are passed to the application as command-line arguments.Note, when you launch an Apollo application that is already running, a new instance of that application is not started. Instead, an invoke event is dispatched to the running instance. In this case, the ADL root-directory and runtime parameters are not significant.
Debugging
The debugging support provided directly by ADL is limited to the printing of trace statements. Use the Flash Debugger (or Flex Builder) for complex debugging issues of SWF-based applications.
Print trace statements to the console used to run ADL with the trace() function. To print a trace statement from ActionScript use:
trace("debug message");
From JavaScript use:
runtime.trace("debug message");
In JavaScript, you can use the alert and confirm functions to display debugging messages from your application. In addition, any uncaught JavaScript exceptions are printed to the console.
Connecting to the Flash Debugger
Note: The FDB can only be used to debug SWF-based applications. HTML-based applications will not connect. The FDB program can be found in the bin directory of your Flex 2 SDK folder.
To debug a SWF-based Apollo application with the Flash Debugger, you must start an FDB session and then launch a debug version of your application. The debug version of a SWF will automatically connect to a "listening" FDB session.
To connect to an FDB session:
- Start FDB.
- The console displays the FDB prompt: <fdb>
- Execute the Run command: <fdb>run [Enter]
- The console displays: Waiting for Player to connect.
- In a different command or shell console, start a debug version of your application: adl myApp-debug.xml
- The FDB console displays a "Player connected; session started" message.
- Using the FDB commands, set breakpoints as desired.
- Type continue [Enter]
- Set any additional breakpoints.
- Type continue [Enter]
- Your application starts.
ADL Examples
Run an application in the current directory:
adl myApp-app.xml
Run an application in a subdirectory of the current directory:
adl source/myApp-app.xml release
Run an application and pass in two command-line arguments, "foo" and "bar":
adl myApp-app.xml -- foo bar
Run an application using a specific Apollo runtime:
adl -runtime /Apollo/XYZ/ApolloSDK/bin myApp-app.xml
Back to: Apollo Documentation home page