For what it's worth (and with all the usual disclaimers about potentially making your mac unstable by disabling system services), here's some commands that will manipulate this service and services like it. Note the $UID in the command, that's just a bash shell variable that will resolve to some number. That's your numeric UID. You just run these commands from a Terminal command line. No special privileges needed.
If you want to disable it entirely, the first command stops it from respawning, and the second kills the one that is currently running:
launchctl disable gui/$UID/com.apple.photoanalysisd
launchctl kill -TERM gui/$UID/com.apple.photoanalysisd
(If you kill it without disabling it will die, but a new one will respawn and pick up where the old one left off)
I don't have this problem myself, so I can't try these next two commands. They're relying on good ole UNIX signals. You could theoretically suspend and resume the process like this ("STOP" and "CONT" are stop and continue):
launchctl kill -STOP gui/$UID/com.apple.photoanalysisd
launchctl kill -CONT gui/$UID/com.apple.photoanalysisd
I don't know what launchd does when running processes are suspended for a long time. Will it detect them as dead and kill and restart them? I dunno. But I do know they won't get any CPU time.
Greetings from the year of 2025, and 6+ years later MacOS Sequoia is still plagued by these evil bloatware, and Apple made them harder than ever to deal with!
If you are on Big Sur (11) or newer, forget about all* the above solutions, none will work!
Firstly, if you are looking for a way to truly exterminate all traces of photo/mediaanalysisd from your system without a doubt (like @ElectronHerder's method), I regret to tell you it is likely impossible now and highly intrusive to attempt, but I'll leave some notes and references on the state of the "permanent fix" methods now from what I've found researching, at the bottom of this post for those truly interested and daring enough to risk it (I ultimately decided I did not want to risk my own device after researching them, so I cannot say for certainty they even work).
Safe solution for Ventura and up
Apple really locked this up by now, so none of the ideal previous approaches here work anymore.
Deleting/moving the binaries/.plist files? Good luck with that, not happening (See the possible "permanent fix" solution for details on why)
launchctl disable
? Sure it pretends to work and adds the "disabled" entry, but it doesn't remove the enabled entry so its effectively useless, amazing.launchctl kill
? Error, "Not privileged to signal service.", even withsudo
or regardless of the signal or syntax you try, it won't let you.The only option left now is to just repeatedly kill the process itself, which we can do with a cron job:
Note: I did not include
photoanalysisd
because I personally haven't seen any activity from that process on my device yet, onlymediaanalysisd
has given me trouble, but you can easily just addphotoanalysisd
in there if you need it too.As for the interval that is also up to you based on how aggressive your instance of photo/mediaanalysisd is being about restarting itself, some people here have mentioned it popping back up within a minute, but mine seems more tame, so I picked every 3 minutes and it seems good enough for my case.
Notice the
-SIGINT
signals, those are important, since they seem to be more effective and keep the process down longer than a regular defaultSIGTERM
does.For anyone reading this unfamiliar with cron on Mac here's a short rundown on how to use this:
.sh
file somewhere permanent (e.g:/Users/[your_username]/.cron-scripts/analysisd_killer.sh
)crontab -e
*/3 * * * * /Users/[your_username]/.cron-scripts/analysisd_killer.sh
(You can change the3
to any number of interval minutes you prefer)MAILTO=""
to prevent this very frequent cron from filling up your disk space with logs in/var/mail
:wq
and press Enter)Now I have already been told that allegedly doing frequent crons like this is bad and one should use a sleeping bash process on an infinite
while true
loop, but I am far too lazy to set that up, and I'm not entirely convinced it matters at all, but to each their own.Lastly, if one is really lazy or for any other reason doesn't want to bother setting up a cron, for what it may be worth, the original proposed solution in the main gist of sending a SIGSTOP signal to the process to freeze it instead of killing it seems to also be effective, at least as far as CPU and GPU hog goes, I verified with
ps wuax | awk '$8 ~ "T"'
to list all SIGSTOP'd processes that it remained stopped for a good while, but I did not like the uncertainty that it could eventually still randomly by unfrozen by the OS without warning, plus it requires the evil process to be running, which makes this difficult to automate on startup. As such I sought the other options found in this comment.Possible "permanent fix" solutions for Big Sur and up
Click to view
Here is an adapted version of @ElectronHerder's solution with required changes that might make it work on Sonoma/Sequoia/+, but I have not tested this due to an apparent high risk of corrupting the system!
Deactivate System Integrity Protection
Hold down Command-R for about ten seconds and press power buttonThe above instruction is for pre-M1 Macs, for M1+ Macs you should hold the power button itself for about 10 seconds. (ref: https://support.apple.com/en-us/102518#applesilicon)
+ and then select "Options" then click the "Continue" button that appears underneath.
csrutil disable
csrutil authenticated-root disable
(See: Big Sur’s Signed System Volume)reboot
Remove or rename the photo/mediaanalysisd files
mkdir ~/livemount
This does not work on Big Sur+, use the command below:mount -uw /
sudo mount -o nobrowse -t apfs /dev/PLACEHOLDER ~/livemount
(See EliteMacX86's guide to figure out what to put instead ofPLACEHOLDER
)cd ~/livemount
mv -v System/Library/LaunchAgents/com.apple.photoanalysisd.plist /Users/[your_username]/Documents/Evilstuff
mv -v System/Library/LaunchAgents/com.apple.mediaanalysisd.plist /Users/[your_username]/Documents/Evilstuff
mv -v System/Library/PrivateFrameworks/PhotoAnalysis.framework/Versions/A/Support/photoanalysisd /Users/[your_username]/Documents/Evilstuff
mv -v System/Library/PrivateFrameworks/MediaAnalysis.framework/Versions/A/mediaanalysisd /Users/[your_username]/Documents/Evilstuff
sudo bless --folder ~/livemount/System/Library/CoreServices --bootefi --create-snapshot
Reactivate System Integrity Protection
Hold down Command-R for about ten seconds and press power buttonM1+: Hold the power button for about 10 seconds.
+ and then select "Options" then click the "Continue" button that appears underneath.
(Apparently you cannot ever turn this back on if you want to preserve your changes but I'm not sure)csrutil authenticated-root enable
csrutil enable
reboot
If you actually took the risk of following these and it works, I'd love to know, please @ me here.
Another possible alternative?: Kernel Extension
In the world of Kernel Extensions it appears they have a solution to this offered by the RestrictEvents kernel extension.
Specifically note the revblock=media option:
Unfortunately these kexts all seem geared towards Hackintosh devices, not real Macs, so it appears to be either difficult, not recommended, or impossible to install them on a real Mac, so I didn't bother any further research on them myself, but I leave the mention of this kext here should any future reader want to venture into these or already knows how to.