I wanted to launch a GUI Application as a User Agent in Macos, but I m not sure about the right way of doing it. I m aware of 2 ways and wanted to know which should be used and why?
- Using the Unix exe present in the .app application bundle for my GUI app. In that case the program entry in the .plist file for the Agent will look like this:
- Using the .app application bundle itself. We cannot directly provide the path for the .app file hence, I m using a script for that. In that case the program entry in the .plist file for the Agent will look like this:
Note: The LaunchGUI.sh is script which uses the 'open' command to launch the GUI .app bundle.
From the Apple man page:
Means you have to specify the path to a shell script or UNIX executable, in case of an application (bundle) the file in
./Contents/MacOS
.If you want to launch an application by its bundle path use
/usr/bin/open
with the-a
or-W
flag.