Debugging a Flex Mobile/PHP Application

This procedure describes how to debug your Flex Mobile/PHP application. This allows you to test your files and applications and detect errors in your code. The debugger allows you to control the execution of your program using a variety of options including setting breakpoints, stepping through your code, and inspecting your variables and parameters.

Before debugging your Flex Mobile/PHP application, you must introspect your PHP service and develop your Flex Mobile and PHP projects.

You must also have an existing database with your application's content that is located on the server.

Running a Flex Mobile/PHP Application in Debug Mode

 

 

Instructions on how to complete a procedure

To run a Flex Mobile/PHP application in debug mode:

  1. Set breakpoints at the desired locations of your Flex Mobile project (in the MXML and/or ActionScript code) and/or PHP Project. For more information see Setting Breakpoints or Adding and removing breakpoints in the Using Adobe Flash Builder 4.5.

Note:

Breakpoints can be placed in the MXML code only, the PHP code only, or both. To debug both the server and client side simultaneously, place breakpoints in both projects.  

  1. To change the default web browser to work with while debugging, go to Windows | Preferences | General | Web Browser. For more information see Web Browser Preferences in the Workbench User Guide.
    The 'Use Internal Web Browser' option does not apply to running and debugging applications. Applications are always run and debugged in an external web browser.

  1. From the Right Click Menu of your Flex Project select Debug As | Mobile (PHP) Application.
    The debug configuration opens with automatically configured settings according to your project.

Note:

If you have more than one configuration for Mobile (PHP) Application, select the configuration you would like to use from the Launch Configuration Selection dialog and click OK.

  1. The application opens in a browser and breakpoints are hit.

See Managing Your Web (PHP) Debug Configuration for information on editing options in the debug configuration.

See Running and Analyzing Debugger Results or Managing the debugging session in the Debug view in the Using Adobe Flash Builder 4.5for more information on the outcome of a debugging process.

Managing Your Mobile (PHP) Application Debug Configuration

 

 

Instructions on how to complete a procedure

To manage your Mobile (PHP) debug configuration:

  1. Click the arrow next to the debug button debug_icon.png on the toolbar and select Debug Configurations -OR- go to Run | Debug Configurations.
    A Debug Configurations dialog will open.

  2. Double-click the Mobile (PHP) option to create a new debug configuration and open the Main tab.

mobile_php_debug_config_main_tab.png

  1. The dialog is made up of the following:

    • Name - Enter a name for the new configuration.
    • Project - The name of your Flex project. Click Browse to select from a list of an available list of projects.
    • Application file - Select the application file you would like to use from the dropdown list.
    • Target platform - The mobile platform on which you would like to debug your application. Select an available platform from the dropdown list.
    • Launch method - The method you would like to use to launch your application. Choose from the following options:
      • On desktop - Choose an available device to simulate from the dropdown list. This option allows you to debug your application on an simulated mobile operating system, meaning you don't need a mobile device for the debug process.
      • On device - This option allows you to debug your application on a mobile device. When selecting this option, you must have your device connected via USB and have access to WiFi. The server side of your application will be downloaded via USB to the device, and debugged via WiFi.
        For the client side of your application, select whether to debug on a device that is attached to your machine via USB, or via WiFi.
        • If you are using the Debug via WiFi option, you can mark/unmark the 'Install the application on the device over USB' option.
    • 'Clear application data on each launch' - Mark this checkbox to clear the application's data each time you launch it.
  2. Open the Server tab.

mobile_php_debug_config_server_tab.png

  1. The dialog is made up of the following:

    • Server Debugger - Select the Server Debugger to be used (by default this will be the Zend Debugger).

    • PHP Server - Select your server from the PHP Server list. To edit your existing server click Configure or click New to open the PHP Server Creation Wizard and configure a new server.
      Configure or edit your server by following the instructions in Adding a New Server to the List or Editing an Existing Server Configuration under the PHP Servers Preferences page.
      For more information on configuring the communication between Flash Builder 4.5 for PHP and your remote server, see Setting Up Remote Debugging.

      • To check whether your server connection is correctly configured, and that Flash Builder 4.5 for PHP can communicate with your server debugger, click Test Debugger.

    • Breakpoint - Select whether the Debugger should stop at the first line of code by marking/unmarking the 'Break at First Line' checkbox.

  1. Click Apply to save your changes. To debug now click Debug, or click Close to save your changes and debug later.
  2. Click Yes if asked whether to open the Debug Perspective.

See Running a Flex Mobile/PHP Application in Debug Mode for information on debugging your application once the debug configuration has been edited.

See Running and Analyzing Debugger Results or Managing the debugging session in the Debug view in the Using Adobe Flash Builder 4.5for more information on the outcome of a debugging process.

 

 

Related Links

Related Links:
Debugging a Flex/PHP Application

Running a Flex Mobile/PHP Application