When writing a desktop application for macOS, in which cases it is useful or advisable to add a menu bar icon? Are there any UI guidelines? And what should happen with the dock icon?
Refer the below MacOS X Human Interface Guidelines.
See the "Menu Bar Extras" section of the "Human Interface Guidelines macOS" documentation enter link description here