Adobe AIR for mobile connect to running debug session

Tag: flex , actionscript-3 , debugging , mobile , air Author: saraklark Date: 2011-05-10

I have a AIR for mobile pure AS3 project that saves a file on the device the first time it runs into the file.applicationStorage directory. The second and subsequent times the application launches I need it to look at that file I've saved.

My problem is that when I debug the application from Flex Builder 4.5 it wipes the application and application storage. So the application always behaves like it is running for the first time. I can't get into a debug session and step through my code as I read in that file.

Does anyone know how to connect to a debug session running on the device? My device in this case is an Android Samsung Galaxy S.

Best Answer

Open up the debug configuration (click the arrow next to the debug icon). There should be an entry on the left for your application. Select it, and there is an option to "Clear application data on each launch". Make sure this is unchecked when you want to debug the file. It might be a good idea to turn this back on during normal development so you don't get any stale data.


Beautiful! Thanks! That solves my application data clearing problem. Any ideas on how to connect to an existing session? Is it possible?
If you run the installed debug version from the device it will prompt you for an IP/port to the debug session. It should say something like MyApp-debug in your apps.