• 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
How to make a LaunchAgent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to make a LaunchAgent


  • Subject: How to make a LaunchAgent
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Mon, 11 Aug 2014 17:07:01 +0700

I have a Xpc Helper, which is local to my App (that is only my App can talk to it) which works fine.

Now I want to convert this Xpc Helper into a LaunchAgent.

I guess I have to start it via SMJobSubmit().
But when I do this with the existing Helper, it crashes, gets restarted, crashes again, etc. ad infinitum.

So the Helper must be modified as well. But how?

And is this the right way to start it?

let mach = [ "de.mdenkmann.Xpc-Exchange" : true ]
let args = [ "/private/tmp/Xpc Exchange.xpc/Contents/MacOS/Xpc Exchange" ]
let job = 	[	"Label"					: "de.mdenkmann.Xpc-Exchange",
			"LimitLoadToSessionType"	: "Background",
			"MachServices"			: mach,
			"StandardErrorPath"		: "/tmp/Xpc Exchange.log",
			"ProgramArguments"		: args
		]
var outError : Unmanaged<CFError>?
var auth : Authorization?
let ok  = SMJobSubmit( kSMDomainUserLaunchd, job, auth, &outError )
ok = true, but then: crash with: "xpc_main() was probably called from a process that is not an XPC service bundle."

Gerriet.


P.S.

SMJobSubmit is deprecated in 10.10. But the documentation mentions no replacement.
What to use instead?


_______________________________________________

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: How to make a LaunchAgent
      • From: Roland King <email@hidden>
  • Prev by Date: Re: Converting to Swift
  • Next by Date: Re: How to make a LaunchAgent
  • Previous by thread: Re: how can i change the UITabBarItem title's color
  • Next by thread: Re: How to make a LaunchAgent
  • Index(es):
    • Date
    • Thread