Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add Scheduling in a Sandboxed app?
    primarykey
    data
    text
    <p>I need to add scheduling to my app. So that my app will launch automatically at a specified time and date. I have done it by referring <a href="http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html#//apple_ref/doc/uid/10000172i-CH1-SW2" rel="nofollow">Scheduling Timed Jobs</a>. I have placed the plist file for scheduling in <code>/Users/username/Library/LaunchAgents</code>. It works well in the non-sandboxed app, but it is not working in a sandboxed app. I can't able to add the scheduling file to the path <code>/Users/username/Library/LaunchAgents</code>. It gives me the error </p> <pre><code>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"} </code></pre> <p>I have added the LaunchAgents Path in Entitlements too.</p> <pre><code>&lt;key&gt;com.apple.security.temporary-exception.files.home-relative-path.read-write&lt;/key&gt; &lt;array&gt; &lt;string&gt;/Library/LaunchAgents/&lt;/string&gt; &lt;/array&gt; </code></pre> <p>But still I can't able to add the scheculing plist in LaunchAgents Directory. Whether I am doing correctly or there is another way for the doing the scheduling in sandboxed app.</p> <p><strong>EDIT 1:</strong><br> If I manually create the folder in <code>/Library/Containers/LaunchAgents</code> and put the plist there I am getting this error:</p> <pre><code>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 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload