I have a very basic macOS bundled application with just the empty delegate methods implemented. I am wanting to launch this application as a daemon but when I am loading my daemon, it fails to run with the error:
The application cannot be opened for an unexpected reason, error=Error Domain=NSCocoaErrorDomain Code=257 "The file “GUIDaemon” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///Users/vipul.g/Library/Developer/Xcode/DerivedData/Build/Products/Debug/GUIDaemon.app/, NSFilePath=/Users/vipul.g/Library/Developer/Xcode/DerivedData/Build/Products/Debug/GUIDaemon.app, NSUnderlyingError=0x600000034870 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
Below is my daemon property list file. Can someone help what am I doing wrong here. I have made sure that my app has all the permission required.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.demo.GUIDaemonApp.plist</string>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/vipul.g/MySystemWorkspace/stderr.log</string>
<key>StandardOutPath</key>
<string>/Users/vipul.g/MySystemWorkspace/stdout.log</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/open</string>
<string>/Users/vipul.g/Library/Developer/Xcode/DerivedData/Build/Products/Debug/GUIDaemon.app</string>
</array>
</dict>
</plist>