views:

1364

answers:

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?

+3  A: 

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

related questions