<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rialvalue.com &#187; air</title>
	<atom:link href="http://www.rialvalue.com/blog/tag/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rialvalue.com/blog</link>
	<description>No Flex No Fun</description>
	<lastBuildDate>Fri, 04 Feb 2011 08:09:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Debugging production ready AIR applications</title>
		<link>http://www.rialvalue.com/blog/2009/08/16/debugging-production-ready-air-applications/</link>
		<comments>http://www.rialvalue.com/blog/2009/08/16/debugging-production-ready-air-applications/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 02:19:49 +0000</pubDate>
		<dc:creator>Xavi Beumala</dc:creator>
				<category><![CDATA[air]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[error handling]]></category>

		<guid isPermaLink="false">http://www.rialvalue.com/blog/?p=62</guid>
		<description><![CDATA[One of the biggest problems around testing installed AIR applications is that testers can&#8217;t see when a runtime exception is triggered. Lots of times the symptom of a problem will be something completely different to the real cause and developers will have to spend much more time trying to figure out what was the root [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest problems around testing installed AIR applications is that testers can&#8217;t see when a runtime exception is triggered. Lots of times the symptom of a problem will be something completely different to the real cause and developers will have to spend much more time trying to figure out what was the root cause of the problem. Even though you have a good logging policy if there&#8217;s an uncaught exception there&#8217;s not too much you can do.</p>
<p>Here are some techniques I&#8217;ve came across to make testing less painful for everybody.</p>
<h4>The debug flag way</h4>
<p>One thing I&#8217;ve been thinking for a while is that there are not two different versions of the AIR runtime; one with debugging enabled and the other without it (the way Flash Player has). This means that there might be a way to enable and disable debugging in the same runtime.  This would allow, at least in some controlled environments, to see Runtime Exceptions and make everybody&#8217;s life easier. At least until we have global error handling implemented directly on AIR or Flash Player. Yes, I agree, It&#8217;s unbelievable that on its 10th version we still are not able to capture global exceptions: <a href="http://bugs.adobe.com/jira/browse/FP-444">FP-444</a> and  <a href="http://bugs.adobe.com/jira/browse/FP-1499">FP-1499</a></p>
<p>Using <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Procmon</a> I realized that when an AIR application is launched it tries to read a file in {INSTALLATION_FOLDER}/META-INF/AIR/debug. See the screenshot. What surprised me was the result &#8220;NAME NOT FOUND&#8221;. Basically the file didn&#8217;t exist in the app I was playing with. After some more trial / error, yes, you&#8217;re right, this is the flag that switches on and off debugging capabilities.</p>
<p><a class="lightbox"  title ="procmon" href="http://www.rialvalue.com/blog/files/picture-3.png"><img src="http://www.rialvalue.com/blog/files/picture-3-300x126.png" alt="" title="procmon" width="300" height="126" class="aligncenter size-medium wp-image-63" /></a></p>
<p>If an AIR application is launched and an empty file with name debug is found in {INSTALLATION_FOLDER}/META-INF/AIR/debug then, any runtime exception will be displayed in a system modal window! In OS the path for this file will be {APPLICATION_FOLDER}.app/Contents/Resources/META-INF/AIR/debug</p>
<p><a class="lightbox"  title ="picture-4" href="http://www.rialvalue.com/blog/files/picture-4.png"><img src="http://www.rialvalue.com/blog/files/picture-4-300x203.png" alt="" title="picture-4" width="300" height="203" class="aligncenter size-medium wp-image-64" /></a></p>
<p>So if testers (or users during the earlier versions of your app) are using your application, make sure they create the debug file and attach any stack trace they see to their bug reports.</p>
<h4>The adl way</h4>
<p>This is not as easy as the previous solution but it gives the testers more options.</p>
<p>Once installed, an AIR application, is not more than the swf file produced from FB, its application descriptor and a native launcher. Given that we have access to the main application swf file and its corresponding descriptor we can use ADL to launch the installed application instead of the native launcher.</p>
<p>Here&#8217;s how:</p>
<p>1. Installed the SDK you want to use from http://opensource.adobe.com/wiki/display/flexsdk/Downloads<br />
2. Uncompress the zip in the location you prefer. I&#8217;ll refer to this folder as {FLEX_HOME}</p>
<p><b>In Windows</b><br />
3. Right click on &#8220;My Computer&#8221; &gt; Properties<br />
4. Go to &#8220;Advanced&#8221; tab<br />
5. Click in the option &#8220;Environment Variables&#8221;<br />
6. In the &#8220;System variables&#8221; find the &#8220;Path&#8221; definition and add this to it (double clicking on it): &#8220;;{FLEX_HOME}/bin&#8221;<br />
7. Make sure your replace {FLEX_HOME} with the path to the folder where you&#8217;ve uncompressed the SDK</p>
<p><b>In OS X</b><br />
3. Open a terminal<br />
4. Execute this command: open ~/.bash_profile<br />
5. Add the following line to the opened file:<br />
PATH=${PATH}:{FLEX_HOME}/bin<br />
6. Make sure your replace {FLEX_HOME} with the path to the folder where you&#8217;ve uncompressed the SDK</p>
<p><b>In Linux</b><br />
3. Open a terminal<br />
4. Edit your profile file ~/.profile<br />
5. Add the line: export PATH=$PATH:$FLEX_HOME</p>
<p>Then to launch the application you will have to:</p>
<p><b>In Windows</b><br />
1. Open a command line window. Start &gt; &#8220;Run &#8230;&#8221; &gt; cmd<br />
2. Navigate to the folder where the application is installed: cd &#8220;Program Files&#8221;/MyApp<br />
3. Execute this command: adl META-INF/AIR/application.xml .<br />
4. Don&#8217;t forget the dot at the end of the command</p>
<p><b>In OS X and Linux</b><br />
1. Open a terminal<br />
2. Navigate to the folder where the application is installed: cd /soft/testAirApp.app/Contents/Resources where testAirApp is the name of your application<br />
3. Execute the following command: adl META-INF/AIR/application.xml .<br />
4. Don&#8217;t forget the dot at the end of the command</p>
<p>If during the execution process there&#8217;s an exception, ADL will show it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rialvalue.com/blog/2009/08/16/debugging-production-ready-air-applications/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

