• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Launchd daemon and LSOpenApplication in Lion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Launchd daemon and LSOpenApplication in Lion


  • Subject: Launchd daemon and LSOpenApplication in Lion
  • From: Michael Domino <email@hidden>
  • Date: Fri, 05 Aug 2011 16:52:09 -0400

Hi,

I run a launched daemon process that in turn launches a Cocoa app in the currently logged-in user's context via LSOpenApplication.

On 10.5 and 10.6, LSOpenApplication launches my Cocoa app with no problems. On 10.7, I get the log entry:

"com.apple.launchd: System: This API can only be used by a process running within an Aqua session."

Does this mean that I can't call LSOpenApplication from a launched daemon in Lion? Is this a new stricter requirement in Lion? Or a Lion bug? Is there any way to use LSOpenApplication from a non-Aqua session in Lion, or do I need to use a launchd agent to get this to work?

I also tried using fork/execve to launch the app, which works. But, after the app is launched it wants to minimize itself. This fails with the error:

"CoreDockMinimizeItems failed (-4959)"

Error -4959 is "Dock not running", but it is running. Is this a Lion bug?

Tech note tn2083 (http://developer.apple.com/library/mac/#technotes/ tn2083/_index.html) says:

"In Mac OS X 10.5 and later it is possible to launch a GUI application from a daemon by calling Launch Services. However, this capability comes with a number of caveats that make it difficult to use in practice. See Process Manager and Launch Services for details."

I've read through all the doc, but haven't seen any of the caveats mentioned in this tn2083 quote. Can anyone elucidate?

Thanks,
Michael

Michael Domino | Identity Finder, LLC
250 West 57th St; Suite 2412 | New York, NY 10107
P: 617-816-5851 | F: 888-206-6389 | E: email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Launchd daemon and LSOpenApplication in Lion
      • From: Jens Alfke <email@hidden>
    • Re: Launchd daemon and LSOpenApplication in Lion
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: August Cocoaheads - Silicon Valley Meeting
  • Next by Date: Re: Launchd daemon and LSOpenApplication in Lion
  • Previous by thread: Re: August Cocoaheads - Silicon Valley Meeting
  • Next by thread: Re: Launchd daemon and LSOpenApplication in Lion
  • Index(es):
    • Date
    • Thread