Saturday, March 21, 2026

launchd – Private LaunchAgent now not works accurately in MacOS 15.x – seems to be as a result of iCloud desktop?

Here’s a strategy to run a script periodically as a LaunchAgent so that it’ll bypass TCC and local-network restrictions. I’ve examined this technique and it really works for me. Reference: MacOS Shortcut scheduling utilizing launchctl

Step 1

In System Settings > Privateness & Safety > Recordsdata & Folders, be sure that the Shortcuts app has full entry. Relying on what the script does, you might also want to present it entry within the Full Disk Entry panel. If the script includes solely entry to the native community (which is technically not managed by TCC), Shortcuts is already approved and also you needn’t change any privateness settings.

Step 2

In Shortcuts, create a shortcut that runs your script, and take a look at it. See the built-in assist if wanted. Give the shortcut a singular identify, comparable to “Instance”.

Step 3

Create a file in ~/Library/LaunchAgents with a singular identify and the filename extension .plist. I will use the identify shortcut.plist.

Beneath is a urged template for the file ~/Library/LaunchAgents/shortcut.plist:




 
   Label
   instance.shortcut
   Program
   /usr/bin/shortcuts
   ProgramArguments
   
     run
     "Instance"
   
   StartCalendarInterval
   
     Hour
     13
     Minute
     15
   
 

This file shall be loaded routinely as a job by launchd.

For the worth of the Label key, use a singular label (not essentially the identical because the filename.)

Within the ProgramArguments array, specify the identify of the shortcut you created in Step 2. Right here I’ve used “Instance”.

There are two methods to specify a price for the important thing StartCalendarInterval. In order for you the job to run solely at one common interval, use a dictionary of integers, as within the above template. If you wish to specify a couple of interval, use an array of dictionaries. See the launchd.plist(5) man web page for particulars.

If the system is shut down or asleep when the job is scheduled to run, it’s going to run as quickly as doable when the system is woke up.

Step 4

The job ought to load routinely, however to verify, enter this command in a shell:

launchctl load ~/Library/LaunchAgents/shortcut.plist

To cease the job from working, enter:

launchctl unload ~/Library/LaunchAgents/shortcut.plist

and take away the file. You should additionally unload after which reload the file after making any modifications.

By modifying the Launch Agent, you may set off the job on any of the occasions supplied for within the man web page, not simply time intervals.

If the agent stops working although you’ve got made no modifications, launch the shortcut manually and provides it no matter permission it prompts for. This motion could should be repeated periodically or after reboots and system updates. Apple typically tinkers with TCC and the main points could differ with time.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles