Sign in Join
Wiki copytemporary

Hiding a macOS app from the Dock: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Overview
22
33While there is no way to hide an application from the Dock at runtime, this can be done at design-time if the application declares itself to be an agent or a background application. These two application categories and their attributes are explained below.
44
55## Agent applications
66
77Agent applications do not appear in the Dock or in the Force Quit window; but they *are visible* to utilities like Activity Monitor, Unix command-line tools (eg top), as well as macOS API functions.. If the agent key exists and is set to YES in the application's .plist file, Launch Services runs the application as an agent. 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.
88
99Agents are often shown in the macOS menu bar, in which case the agent application should provide a StatusBar (TTrayIcon) user interface and hotkeys if it needs a menu-like user interface.
1010
1111For example, startlazarus is an agent application, launched by the Lazarus IDE when rebuilt. Similarly, the Dock and Login Window are also two applications that run as agents.
1212
1313To declare an application to be an **agent application**, use Xcode to open the application's bundle Info.plist file:
1414
1515- add a property *UIElement* (or "Application is agent");
1616- set the *UIElement* property's value to True;
1717- save the Info.plist file.
1818
19-<figure>
20-<img src="infoplist_agent.png" title="infoplist_agent.png" />
21-<figcaption>infoplist_agent.png</figcaption>
22-</figure>
19+![](/wiki-images/f/f2/Infoplist_agent.png)
2320
2421## Background only applications
2522
2623A background only application runs only in the background. If background application key exists and is set to YES, 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.
2724
2825As background applications are *never shown* in the macOS menu bar, you should be launch/terminate the application with another GUI application.
2926
3027To declare an application to be a **background application**, use Xcode to open the application's bundle Info.plist file:
3128
3229- add a property *LSBackgroundOnly* (or "Application is background only");
3330- set the *LSBackgroundOnly* property's value to True;
3431- save the Info.plist file.
3532
36-<figure>
37-<img src="infoplist_bkgrndapp.png" title="infoplist_bkgrndapp.png" />
38-<figcaption>infoplist_bkgrndapp.png</figcaption>
39-</figure>
33+![](/wiki-images/8/86/Infoplist_bkgrndapp.png)
4034
4135## See also
4236
4337- [[Application disable resize over Dock]]
4438- [[Bounce Application Icon in Dock]]
4539- [[macOS Application Dock Menu]]
4640- [[Show Badge on Application Icon in Dock]]
4741
4842## External links
4943
5044- [Apple: Technical Note TN2083 - Daemons and Agents](https://developer.apple.com/library/archive/technotes/tn2083/_index.html#/apple_ref/doc/uid/DTS10003794)
5145- [Apple: Pre Login Agents](https://developer.apple.com/library/archive/samplecode/PreLoginAgents/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004414)
5246- [Apple: Daemons and Services Programming Guide](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html#//apple_ref/doc/uid/10000172i-SW1-SW1)
5347
5448---
5549*From the Free Pascal wiki, page "Hiding a macOS app from the Dock", as it stood on 2021-12-15 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
5650Category: Platform-sensitive development
5751Category: macOS

Back to history