1

I'm working on automating the installation of a macOS application using Ansible. I am installing the application by copying its .app folder from a .dmg image to the /Applications/ directory.

After doing this, I attempt to launch the application via SSH with:

sudo -u buildworker open -a /Applications/Name.app 

However, I receive the following error message:

The application /Applications/Name.app cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed."

Strangely, if I log into the machine's GUI and manually start the application once, subsequent attempts to launch it via SSH work perfectly.

Has anyone encountered a similar issue before? Is there any way to "pre-initialize" the application so that it can be launched via SSH without a manual first-time GUI launch?

OS: macOS Monterey (12.6.7)

  • The app is not in com.apple.quarantine
  • I disabled gatekeeper The app
  • The app is completly signed for macOS

1 Answer 1

0

Did you try to login directly as "buildworker" user through SSH using X11 forwarding ?

You will need to enable X11 forwarding on both the server (https://manpages.debian.org/bullseye/openssh-server/sshd_config.5.en.html#X11Forwarding~2) and the client ("-X" cli option).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.