This blog post details the steps to disable XProtect on macOS. XProtect checks for known malicious content whenever:
- An app is first launched.
- An app has been modified in the file system.
- XProtect signatures are updated.
Please do not disable XProtect/Gatekeeper just to speed up Rust binaries or compile times on macOS. This is poor advice, similar to the many forum posts or tutorials that suggest disabling SELinux on Linux to solve minor configuration issues
https://nnethercote.github.io/2025/09/04/faster-rust-builds-on-mac.html