There have been various reports that the mediaanalysisd background process was causing excessive CPU usage in macOS when scanning photos.Here’s what it is, what it does, and how to stop it.
For the past year, discussions have raged on the Internet about whether Apple silently analyzes users’ photo libraries in order to send them to law enforcement.Independent testing has confirmed beyond a shadow of a doubt that this is not the case.
But various sources have reported high CPU usage in media analysis.This background processing can stress your Mac’s processors and slow down your computer to varying degrees.Even in the absence of any silent reports from Apple, mediaanalysisd simply scans photo libraries for AI purposes such as face recognition and Spotlight indexing.
In any case, you can disable mediaanalysisd to prevent excessive CPU usage.
To do this, you first need to disable macOS System Integrity Protection (SIP).
How to disable System Integrity Protection in macOS
To disable SIP on macOS, follow the instructions on Apple’s SIP page.
Apple cautions that disabling System Integrity Protection should only be done temporarily and should be re-enabled as soon as possible after doing so.The company also says it can make your computer “vulnerable to malicious code.”
Disabling SIP involves restarting the Mac in recovery mode and typing in Terminal:
You may or may not need to unlock the LaunchAgents directory itself by changing the permissions on the directory.Just remember to revert the permissions back to the way they were when you’re done.You can use a third party utility like BatchMod for this:

Do not change user or group permissions on the folder, only -rxw permissions.Don’t forget to reset them to their original state when you’re done.
Then delete /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist in Terminal by typing:
sudo rm -R /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist
Apple’s com.apple.mediaanalysisd.plist is a Launch Services daemon loader file that tells macOS where to find the mediaanalysisd binary and how to run it.Once com.apple.mediaanalysisd.plist is removed, macOS will no longer launch it on startup or intermittently.
If macOS automatically regenerates the .plist file, you will need to edit the file directly to set the com.apple.mediaanalysisd.photos setting to NO.The default value is YES.
Keep in mind that editing this file may change your Mac’s behavior or even render some parts non-functional, so do so at your own risk.
You can also try changing com.apple.mediaanalysisd.realtime from YES to NO.In fact, you can try disabling all MachServices settings except for two Homekit settings.But again, it’s currently unclear what each of them does.
But again, keep in mind that changing these settings will disable some macOS features, namely Spotlight indexing and text highlighting in photos and previews.
You can also play with the EnableTransactions setting, although it’s not yet clear whether this setting tells the daemon to use network transactions or not.
Apple plist files are just XML files.So, if you know XML, you can use any text editor or use Apple’s Xcode authoring tool to modify them.
When editing .plist files in Xcode, you get a built-in editor that converts the XML into a table of editable fields with data types and presets for some types in a central column:

.plist also gives us an idea of where on disk in macOS the real daemon binary is located.In the field “ProgramArguments”: in “Item 0” we see the value:
/System/Library/PrivateFrameworks/MediaAnalysis.framework/Versions/A/mediaanalysisd
So the mediaanalysisd binary itself is inside the MediaAnalysis.framework package.It is not clear what the effect of disabling this package will be, but do so at your own risk as we have not determined the impact of removing this framework from the system.
Let’s take a look at .plist LaunchEvents
Examining the LaunchEvents->com.apple.xpc.activity dictionary in the .plist file, we see a few more interesting items.In fact, this dictionary contains five items of photo analysis:
com.apple.mediaanalysisd.photosanalysis com.apple.mediaanalysisd.photos.visualsearch com.apple.mediaanalysisd.photos.face com.apple.mediaanalysisd.photos.maintenance com.apple.mediaanalysisd.photos.ocr
XPC (sometimes referred to as IPC) is Apple’s inter-process communication technology that allows applications to communicate with each other through XPC services, including over the network.
Obviously, the com.apple.mediaanalysisd.photos.ocr task is used to convert words in images to text for both highlighting and Spotlight.
But the full extent of what com.apple.mediaanalysisd.photosanalysis and com.apple.mediaanalysisd.photos.maintenance do is still unknown.
The “ExpectedDuration” field of each com.apple.xpc.activity element is the time in seconds for the task to complete.So “3600” would be 60 minutes – one hour.
Also of interest are the “Priority” and “CPU Intensity” fields.It’s not clear how setting the CPUIntensive field to NO will affect system performance, and there’s very little documentation from Apple on the subject.
The Interval field is the time between process launches, also in seconds.In the case of com.apple.mediaanalysisd.photosanalysis, this value is 7200, which means 120 minutes.
The Interval field for the com.apple.mediaanalysisd.photos.maintenance service is set to 86400 by default, which means it runs once every 24 hours.
There are also fields indicating whether the task is repeated, whether it runs during screen savers, and during PowerNap.
Final thoughts and additional information
Much of the macOS daemon architecture is managed by a background daemon called launchd that manages the startup, startup, and shutdown of daemons.You can learn more about launchd in the Terminal using the man page:
man launchd and pressing Return.
There is another terminal command, launchctl, which interacts with launchd to manage daemons and background processes.It also has a help page for usage and more information.
In the Terminal, you can also view all running processes (applications and daemons) on your Mac by typing top:
An easier and cleaner way is to use the Apple app /Applications/Utilities/Activity Monitor.By typing “media” in the search box, you’ll see mediaanalysisd being used:

If you double-click a process name in the Activity Monitor, you will get a window with more detailed information about the process:

On the Open Files and Ports tab, we can also see a little more about where mediaanalysisd interacts with the file system.We also see that it uses several other Apple frameworks:
CoreNLP.framework DataDetectorsCore.framework Lexicon.framework MetalPerformanceShaders.framework
We also learn from this log that there is another mysterious Apple daemon in the system: analyticsd.There is a man page for analyticsd, but it doesn’t provide much information and just says it’s used for “diagnostics”.