I'm making a macOS MenuBar app only, so how would you hide the App's Icon from the macOS dock when it's launched?
I haven't seen anywhere where this is explain nor found any SwiftUI APIS/interactions with the AppDelegate.
You need to set the following property in your Info.plist Application is agent (UIElement) to YES
You can find it in the documentation here.
Or you can manually edit the Info.plist and add the following key:
<key>LSUIElement</key>
<true/>
You can read about it here
LSUIElement (Boolean - macOS) specifies whether the app runs as an agent app. If this key is set to YES, Launch Services runs the app as an agent app. Agent apps do not appear in the Dock or in the Force Quit window. Although they typically run as background apps, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent app brings that app forward to handle events.
The Dock and loginwindow are two apps that run as agent apps.