Are there any way to hide the dock icon but keep the menubar icon?
You have to edit the Plist file for the app. Plist files use a key/value format, declaring the type of the key. The correct code is:

&lt;key&gt;LSUIElement&lt;/key&gt;
&lt;string&gt;true&lt;/string&gt;


Stick these in before the &lt;/dict&gt; &lt;/plist&gt; lines, and voilà. This works as late as High Sierra, and on the apps I have done this for it does eliminate the dock icon but not the menu bar one.