osx - How to add Scheduling in a Sandboxed app? -
i need add scheduling app. app launch automatically @ specified time , date. have done referring scheduling timed jobs. have placed plist file scheduling in /users/username/library/launchagents
. works in non-sandboxed app, not working in sandboxed app. can't able add scheduling file path /users/username/library/launchagents
. gives me error
error domain=nscocoaerrordomain code=513 "“com.sample.schedule.plist” couldn’t copied because don’t have permission 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 completed. operation not permitted"}
i have added launchagents path in entitlements too.
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key> <array> <string>/library/launchagents/</string> </array>
but still can't able add scheculing plist in launchagents directory. whether doing correctly or there way doing scheduling in sandboxed app.
edit 1:
if manually create folder in /library/containers/launchagents
, put plist there getting 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 not connected
try putting job plist
/users/<username>/library/containers/<my app identifier>/data/library/launchagents/<my app identifier>.<somename>.plist
this data container sandboxed app.
looking on mac see facetime has 2 scheduled job plists in there can use example.
Comments
Post a Comment