How can I hide an app from the dock while keeping it in the menu bar? There's a messaging app I often use that includes both a menu bar icon (to hide/show the window, as well as indicate how many unread messages there are) as well as the app itself which resides in the dock/launchpad.

I want to know if there's a way to hide the app from my dock when the app is running so that I can simply use the menu bar to see if I have any new messages and thus save dock space. I know that this is possible as some of my other apps already do this (e.g. LastPass for Mac), but is there a way to do this manually, e.g. through the Terminal? I am currently on MacOS Catalina Beta (although I assume the solution should also work for earlier versions too).
I want to know if there's a way to hide the app from my dock when the app is running so that I can simply use the menu bar to see if I have any new messages and thus save dock space


An app can be configured to hide it's Dock icon, and show it only in the Menu bar, only if it is designed (programmed) to provide this functionality. If the app doesn't include this feature, it's not possible for user to achieve this by any other means (OS built-in or using any 3rd party tool).