Bundling the CLI into an app on macOS

I tried to create a new macOS app using the CLI as the main executable so that it can be whitelisted with the Full Disk Access. It seems to work. However, there are 2 issues:

  • The CLI app can only be opened in the Terminal by open /Applications/DuplicacyCLI.app --args .... Invoking the main executable within the bundle /Applications\DuplicacyCLI.app/Contents/MacOS/duplicacy_osx_x64 still gives the no permission error.
  • Even if the CLI can be invoked by the open command, there is no output. As I understand, open doesn’t run the executable directly but rather passes it to a background service which then starts the CLIp process. Therefore no output from the CLI process is shown in the Terminal.

I wonder what the usage would be for such a wrapper app and if lack of output is acceptable.

I think since it’s now a “proper” app bundle it should not be logging to stdout, (because it may not or likely won’t even have console attached) but use dedicated logging facilities like os_log. In fact, it’s probably a good idea to do that even in standalone Duplicacy CLi (if it does not automatically get echoes to stdout then log to both)