This tutorial aims to explain you how to debug an AS/Flex mobile application on an Google Android device (here an Archos internet tablet) with Flash Builder 4.5 over the USB interface. This procedure will allow you to save a lot of time in order to simplify the testing process in real conditions (Instead of compiling the application, copy the apk on the device, install it and run it each time you want test your application).
- Preparing your Google Android to enable the USB debugging
To run and debug applications AS / Flex directly on a Google Android device you must first enable the USB debugging. To do this take your device and follow the instructions below:
- Unplug your USB cable if connected.
- Go to the home and press Menu > Settings > Application > Development.
- Then activate the “USB Debugging“.
- After connect the device to your computer using a USB cable.
- Extend the notification area on your phone (press top of the screen on your GS and slide it down). You should see an indication which is kind of “USB connected” or “USB connection”.
- Press the “USB connected” and verify that the mass-storage mode is disabled.
- Download the Archos internet tablet drivers
Now we will download the Archos internet tablet USB drivers and add the vendor id to the Android SDK’s file namely adb_usb.ini:
- To start download the USB Archos ADB driver for Windows here: ftp://support.archos.com/ARCHOS%20it/ADB/adb_winusb_driver.zip
- Then expand the archive into the installation directory of Android for example.
- To finish run the Windows Command Prompt and put this line:
echo 0x0e79 >> "%USERPROFILE%\.android\adb_usb.ini"
- Install the USB Archos ADB driver for Windows
We still to install the driver in order to allow Windows to recognize the device and to communicate with it. To do that:
- Firstly connect your Android device on an USB port of your computer.
- Then make a right-click on the “Computer” folder from the desktop or from the Windows explorer and choose “Manage“.
- After open the “Device Manager” in the left side panel.
- Locate and expands “Other Devices” in the right panel.
- After make a right-click on the device name (normally A101it) and select “Update Drivers…“.
- Select “Browse my computer for driver software“, click on “Browse…” and then locate the folder of the USB drivers previously downloaded.
- To finish click on “Next…” to install the driver. Install the driver software anyway if a security popup is displayed.
Voilà, now your Windows could communicate your Android device with.
Now we are going to test that everything works properly:
- Firstly open one of your AS/Flex mobile projects or create one.
- Then go to the menu Run > “Debugs configuration…“.
- After create a new “Mobile Application” configuration.
- Remember to select “Google Android” in the “Target Platforms” section and the “On Device” into the “Launch Method” (Select the “Debug via USB” option).
- To finish click on “Debug“.
A popup should open and ask you to choose the device on which you want to run the application.
Select your device and click on OK (If there is nothing try to refresh the list, otherwise if you make the manipulation for the first time try to reboot your PC to allow Windows to take in charge the driver).
Well, now your application should run correctly in debug mode on your Android device.