Search code examples
cronwebcammacos-mojave

How do I grant a cron job webcam access in Mac OSX Mojave?


In OSX Mojave, access to the camera is controlled by pop-up dialogs and the new System Preferences>>Security & Privacy>>Privacy>>camera panel, where apps can be granted (or denied) access to the camera.

I can grant "iterm2" access to the camera, which lets me run imagesnap from the commandline.

I use a cron job to capture a photograph of the cat bed every 60 seconds. This now fails, since upgrade to Mojave, because it does not have permission to access the camera. Is there any way I can give my cron job access? I don't get a pop-up dialog for a cron job.


Solution

  • Using an Automator application wrapper also works. Create the wrapper (run shell script), run in manually and grant it permission. Then the cron job can call the Automator app.