Testing and Debugging

0
196

The Adobe remote debugging session uses either USB (recommended) or WiFi, hence our Internet permission setup earlier.

For networking, turn on WiFi on the device and connect it to the same wireless network as your development computer under Settings→Wireless & Networks→Wi-Fi. If you are on Windows, make sure you disable your firewall (port 7935 must be open).

Using Flash Professional

To test and debug in Flash Professional, follow these steps:

  1. Select File→AIR Android settings.
  2. Under the Deployment tab, for “Android deployment type”, choose Debug (see Figure 2-3).
  3. Start a debug session by selecting Debug→Begin Remote Debug Session→Action- Script 3.0. Launch the application on the device.

If you are debugging using WiFi, when you are prompted for a hostname or IP address, enter it. On Windows, you can obtain this information by typing ipconfig at the command prompt. On the Mac, click on the WiFi icon and select Open Network Preferences; if you are using the Terminal window, type ifconfig and look for the address at the beginning of the line starting with “inet”.

When the session starts, you should see “Waiting for Player to connect…” Now launch your application. You should see “Remote Flash Player: app:/first.swf”.

Deployment tab of AIR for Android SettingsUsing Flash Builder

To test and debug in Flash Builder, click the Debug button at the top of the screen. When you click on the button you should see the trace statements in your Console window (see Figure 2-4).

In addition to traces in the output window, you get breakpoint control, the ability to step through code, and variable monitoring.

There is a known issue with debugging not working the first time after installation on the device. Force-stop your application on the device and launch it again. This bug should be fixed in a future release.

Debug Settings option