I need to add a schedule to my application. So my application will start automatically at the specified time and date. I did this, referring to the scheduling of temporary tasks . I placed the plist file for planning in /Users/username/Library/LaunchAgents . It works fine in an application without a sandbox, but it does not work in an isolated application. I cannot add the scheduling file to the path /Users/username/Library/LaunchAgents . It gives me an error
Error Domain=NSCocoaErrorDomain Code=513 ""com.sample.schedule.plist" couldn't be copied because you don't have permission to access "LaunchAgents"." UserInfo=0x100114f10 {NSSourceFilePathErrorKey=/Users/username/Library/Developer/Xcode/DerivedData/SchedulingInSandbox-cernhnigkuqhehbndryxlekpiiiu/Build/Products/Debug/SchedulingInSandbox.app/Contents/Resources/com.sample.schedule.plist, NSUserStringVariant=( Copy ), NSDestinationFilePath=/Users/username/Library/LaunchAgents/com.sample.schedule.plist, NSFilePath=/Users/username/Library/Developer/Xcode/DerivedData/SchedulingInSandbox-cernhnigkuqhehbndryxlekpiiiu/Build/Products/Debug/SchedulingInSandbox.app/Contents/Resources/com.sample.schedule.plist, NSUnderlyingError=0x1001132d0 "The operation couldn't be completed. Operation not permitted"}
I also added the LaunchAgents rights path.
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key> <array> <string>/Library/LaunchAgents/</string> </array>
But still, I cannot add a bar for scaling in the LaunchAgents Directory. Am I doing this right or is there another way to do the planning in an isolated application.
EDIT 1:
If I manually create a folder in /Library/Containers/LaunchAgents and put plist, I get this error:
Could not open job overrides database at: /private/var/db/launchd.db/com.apple.launchd.peruser.501/overrides.plist: 1: Operation not permitted launch_msg(): Socket is not connected
source share