Remote debugging with FDB over USB

AIR 2.6 (Android) AIR 3.3 (iOS)

To debug an app over a USB connection, you package the application
using the ‑listen option instead of the -connect option.
When you specify the ‑listen option, the runtime
listens for a connection from the Flash debugger (FDB) on TCP port
7936 when you launch the application. You then run FDB with the -p option,
and FDB initiates the connection.

USB debugging procedure for Android

In order for the Flash debugger running on the desktop computer
to connect to the AIR runtime running on the device or emulator,
you must use the Android Debug Bridge (ADB - utility from the Android
SDK) or the iOS Debug Bridge (IDB - utility from the AIR SDK) to
forward the device port to the desktop port.

Open a terminal or command prompt window and navigate
to the directory containing the source code for the application.

Compile the application with amxmlc, enabling debugging:

amxmlc -debug DebugExample.as

Package the application using the appropriate debug target
(such as apk-debug) and specify the ‑listen option:

Connect the device to the debug computer with a USB cable.
(You can also use this procedure to debug an application running
in an emulator, in which case, a USB connection is not necessary
— or possible.)

Install the application.

You can use the ADT -installApp command:

adt -installApp -platform android -package DebugExample.apk

Forward TCP port 7936 from the device or emulator to the
desktop computer using the Android ADB utility:

Note: Port number 7936 is used as the default for USB debugging
by both the AIR runtime and FDB. You can specify different ports
to use with the ADT -listen port parameter and the FDB -p port parameter.
In this case you must use the Android Debug Bridge utility to forward
the port number specified in ADT to the port specified in FDB: adb forward tcp:adt_listen_port# tcp:fdb_port#

USB debugging procedure for iOS

In order for the Flash debugger running on the desktop computer
to connect to the AIR runtime running on the device or emulator,
you must use the iOS Debug Bridge (IDB - utility from the AIR SDK)
to forward the device port to the desktop port.

Open a terminal or command prompt window and navigate
to the directory containing the source code for the application.

Compile the application with amxmlc, enabling debugging:

amxmlc -debug DebugExample.as

Package the application using the appropriate debug target
(such as ipa-debug or ipa-debug-interpreter,
and specify the ‑listen option:

Connect the device to the debug computer with a USB cable.
(You can also use this procedure to debug an application running
in an emulator, in which case, a USB connection is not necessary
— or possible.)

Install and launch the application on the iOS device. In
AIR 3.4 and higher, you can use adt ‑installApp to
install the application over USB.

Determine the device handle by using the idb -devices command
(IDB is located in air_sdk_root/lib/aot/bin/iOSBin/idb):

When the remote connection is established, you can set breakpoints
with the FDB break command and then start execution
with the continue command:

Note: Port number 7936 is used as the default for USB debugging
by both the AIR runtime and FDB. You can specify different ports
to use with the IDB -listen port parameter and the FDB -p port parameter.

Twitter™ and Facebook posts are not covered under the terms of Creative Commons.