Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sivaprakash

macrumors member
Original poster
Mar 10, 2011
52
0
Chennai, India
Hi

If I enable "Application is background only" for an application it works in background then how it differs from Daemon Services (Launch Agents). Because both of them are running in background and starts itself.

Thanks
Siva
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
Quote from the Launch Services Keys chapter of the Information Property List Key Reference.

LSBackgroundOnly
LSBackgroundOnly (Boolean - Mac OS X) specifies whether this application runs only in the background. If this key exists and is set to “1”, Launch Services runs the application in the background only. You can use this key to create faceless background applications. You should also use this key if your application uses higher-level frameworks that connect to the window server, but are not intended to be visible to users. Background applications must be compiled as Mach-O executables. This option is not available for CFM applications.

LSUIElement
LSUIElement (String - Mac OS X) specifies whether the application runs as an agent application. If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent application brings that application forward to handle events.

The Dock and loginwindow are two applications that run as agent applications.

Setting either of these in your app's Info.plist won't cause your application to automatically start. They're just about what is visible (or potentially visible) to the user once it does start.

So you'd potentially used a combination of both setting up launchd to actually start your program, and setting one of these keys to keep it out of the user's way.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.