A couple of questions about Adobe AIR

So I installed and compiled to AIR using

openfl test project.xml air

It ran just fine but when I closed it I noticed the file it created has a .swf extension rather than .air, is it supposed to be like that?
It’s been a while since I made an AIR app but aren’t you supposed to make a self signed certificate for it?
And is it possible to have AIR show up as an option in the target dropdown in haxedevelop?

Thank you

Also, when I try to open the file from the folder I get this error:

ReferenceError: Error #1065: Variable flash.desktop::NativeApplication is not defined.

We generate only the SWF file (which is used in debugging from the AIR debug launcher) by default, because it builds faster.

For releases, you would want to use the openfl deploy air option, which should generate output for a captive runtime executable, which also still has an AIR *.swf file, but includes an executable for running it

1 Like

Hey there!
When I’m trying to use the openfl deploy air option, I just get a folder and a *.zip-file instead of an *.air package or *.app / *.exe file like I’m used to get in FB / FDT projects for the shared or captive runtime option.
Tested it on mac and pc, with my own project in vscode and the openfl samples on the command line. Always the same result… What am I missing or doing wrong?
(haxe version 4.0.5 and openfl 8.9.5)

Update: after the adt command did not work with the air folder (some certificate error) and the contents in the dist-folder looked very familiar to me I figured out that I can just rename the folder to “{myApp}.app” on the mac and it runs perfect with the captive runtime.
But is there still an option to generate an *.air - file for the shared runtime?

I think we support only the SWF file (for local debugging) or the captive runtime version (for deployment) in the Lime tools at the moment but this would not be difficult to support – it probably is just changing a string or a single command within the tools. Perhaps we could support an argument on either build or deploy to generate the AIR file?

An obvious answer is “yes you can generate it manually” but that’s not the point of tools

Lime uses this source code for the AIR target:

You can make changes to this in your local install and use lime rebuild tools to recompile. Open to suggestions or pull requests

Thank you! That helped me a lot. I’m not sure if it’s the best solution, but as a quick fix this works pretty well for me:
I didn’t change much in the AIRPlatform class (besides deactivating file compression), but
what did the trick was like you suggested using a flag in the top of the build-method of the AIRHelper class.
https://github.com/haxelime/lime/blob/develop/src/lime/tools/AIRHelper.hx

var airTarget:String = "air";
	var extension:String = ".air";

	switch (targetPlatform)
	{
		case MAC:
			if (project.targetFlags.exists("captive"))
			{
				airTarget = "bundle";
				extension = ".app";
			}
		// extension = ".app";

		case WINDOWS:
			if (project.targetFlags.exists("captive"))
				{
					airTarget = "bundle";
					extension = "";
				}

So now I can use the target flag for shared or captive runtime:

openfl deploy air
openfl deploy air -captive

Perfect – you think you could do a pull request? That’s seems like a good approach!

Cool, thank you! Sent you a request for review.