Hiding a macOS app from the Dock

From Free Pascal wiki

English (en)

There is no way to hide an application from the Dock at run-time, but the application can declare itself to be an agent. macOS doesn't show agents in the Dock or in the Force Quit Applications window. Agents are visible for utilities like Activity Monitor, Unix command-line tools (eg top), as well as macOS API functions.


Warning: Agents are never shown in application's menu. So the agent application should provide a StatusBar (TTrayIcon) user interface, hotkeys so they can be switched off, or should be launched/terminated by another GUI application.

For example, startlazarus is an agent, launched by the Lazarus IDE when rebuilt.

To declare an application to be an agent, open the application's bundle Info.plist file:

  • add a property LSUIElement (or "Application is agent");
  • set LSUIElement property's value to True (or check with the checkbox);
  • save the Info.plist file.