1

I'm trying to build an application using AIR 2's new NativeProcess API's going from Brent's little video:

http://tv.adobe.com/watch/adc-presents/preview-command-line-integration-in-adobe-air-2

but I'm having some issues, namely I get an error every time I try to start my process.

I am running OS X 10.5.8 and I want to run diskutil and get a list of all mounted volumes.

Here is the code I am trying:

        private function unmountVolume():void
        {
            if(!this.deviceMounted){ return; }

            // OS X
            if (Capabilities.os.indexOf("Mac") == 0){
                diskutil = new NativeProcess();

                // TODO: should really add event listeners
                // in case of error

                diskutil.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onDiskutilOut);

                var startupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
                startupInfo.executable = new File('/usr/sbin/diskutil');

                var args:Vector.<String> = new Vector.<String>();
                args.push("list");
                //args.push(this.currentVolumeNativePath);

                startupInfo.arguments = args;
                diskutil.start(startupInfo);
            }
        }

which seems pretty straightforward and was based off of his grep example.

Any ideas of what I'm doing wrong?

bug-a-lot
  • 2,446
  • 1
  • 22
  • 27
ashgromnies
  • 3,266
  • 4
  • 27
  • 43

1 Answers1

4

The issue was that the following line was not added to my descriptor:

<supportedProfiles>extendedDesktop</supportedProfiles>

That should really be better documented :) It wasn't mentioned in the video.

ashgromnies
  • 3,266
  • 4
  • 27
  • 43
  • 1
    I think actual tag will be like this: extendedDesktop desktop Apart from this, if you install the ".air" package of an application, which use the Native Process, then you'll also get an error of "Native Process Not Supported" because if your application opens any Native Process, then you must make Native installer of that application i.e .exe for windows, .deb for linux. – Mudasir Bhutto Apr 10 '11 at 13:55