惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
Spread Privacy
Spread Privacy
V
Visual Studio Blog
爱范儿
爱范儿
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
B
Blog RSS Feed
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
The Register - Security
The Register - Security
Latest news
Latest news
The Cloudflare Blog
Project Zero
Project Zero
月光博客
月光博客
U
Unit 42
Vercel News
Vercel News
Attack and Defense Labs
Attack and Defense Labs
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
F
Full Disclosure
Schneier on Security
Schneier on Security
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
博客园 - 叶小钗
腾讯CDC
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - Franky
S
Security Affairs
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
SecWiki News
SecWiki News
Recorded Future
Recorded Future
NISL@THU
NISL@THU
Hacker News - Newest:
Hacker News - Newest: "LLM"
Cloudbric
Cloudbric

Comments for The Eclectic Light Company

Should you try Golden Gate beta? Solutions to Saturday Mac riddles 367 In the shadow: Diego Velázquez Comment on Last Week on My Mac: Freshen up your documents by David Comment on Happy 250th birthday America 2 by mac Happy 250th birthday America 1 Brushstrokes: Portraits 1760-1877 Spotlight and Core Spotlight are different Comment on Sort order, collation and the Finder by eyelessjerry Comment on Apple has just released macOS 26.5.2 Tahoe by Derek Currie Great Ladies of Impressionism: Marie Bracquemond Comment on Get more from your Mac’s log by extending its duration by John Gilbert Comment on Keep your Mac cool using physics by F Portraits of trees: Coppices and pollards Comment on Firmware has become complicated again by John Woods Comment on Logistician 1.2 fixes a couple of bugs by info395288a4d1d Comment on What does Activity Monitor measure? by hoakley Last Week on My Mac: Spotlight on semantics An American in Paris: paintings of Henry Ossawa Tanner 1902-1930 An American in Paris: paintings of Henry Ossawa Tanner 1880-1902 Great Ladies of Impressionism: Berthe Morisot 1874-1891 What to do with a hot Mac Deprecations and removals from Golden Gate Brushstrokes: From El Greco to Rembrandt Portraits of trees: Dutch Golden Age How to get the most from SilentKnight 3 Comment on Hero or hooligan: Achilles becomes the warrior by Deborah J. Brasket Solutions to Saturday Mac riddles 365 Comment on SilentKnight 3.0 for Apple silicon Macs running Sequoia and later (full release) by michaelriccioli Comment on Last Week on My Mac: Uncompressed compressed files by fds Comment on Explainer: Memory by jzonedotcom Comment on Colin Campbell Cooper painting America: 1896-1910 by House of Heart Brushstrokes: 16th century What can you do when an app uses too much memory? SilentKnight 3 second beta adds text and JSON reporting In the shadow: Caravaggism What to do with your encrypted HFS+ disks First beta-test version of SilentKnight 3 for Apple silicon Macs Hero or hooligan: Jason and Medea Comment on Fix documents that won’t open as expected using Quarant2 by EcleX Last Week on My Mac: The mystery of Safari’s Web Archives Last Week on My Mac: Why is it so hard to open a document? Explainer: Disk encryption In the shadow: Caravaggio Brushstrokes: innovators of the first century Changing Paintings: 36 Theseus and the Minotaur macOS virtualisation is leaping forward in Golden Gate Why can’t Preview open that PDF? Crossing the Golden Gate, Intel support, and an update to SystHist Reading the Finder’s Get Info dialog In memoriam Mary Cassatt: 2, 1880-81 Last Week on My Mac: What’s in a name? Explainer: Getting a location Get more from Get Info and the Finder’s contextual menu Stop your photos revealing your location Have you saved thousands of versions? Versatility 1.2 might be what you need Apple has released an update to XProtect for all macOS Apple has released macOS Tahoe 26.5.1 Comment on What Location Services do in macOS by Tristan Hubsch Comment on Protect files with the Locked or Immutable flag by markbot2zero Portraits of trees: Introduction Comment on Online reference to external displays for Apple silicon Macs by Brian What’s in that phishing email? How to search document versions Rubens’ Peace and War Comment on Last Week on My Mac: Syncing metadata in iCloud Drive by hoakley A weekend with Misia: 2 How to search Time Machine backups? Medium and message: Pottery Hero or hooligan: Theseus and the sandals How QuickLook provides thumbnails and previews Hunting extended attributes with an update to xattred Saturday Mac riddles 360 Comment on How to preserve versions, and how to create versioned PDFs by markbot2zero Comment on What gets synced in iCloud Drive? by hoakley Solutions to Saturday Mac riddles 359 Last Week on My Mac: snapshots, the elephant in APFS How to check whether Spotlight is getting the right metadata macOS Tahoe no longer fully supports Time Capsules The bicentenary of Frederic Edwin Church: 1857-77 macOS virtual machines and audio-video syncing Comment on Use Finder tags for categories by Chuck Last Week on My Mac: Dependency and skill fade Comment on Virtualisation on Apple silicon Macs is different by AndyS Painting Pandora and her box: 1883-1919 Mac Easter eggs Painting Spring blossom 2 Comment on The macOS Natural Language framework and Nalaprop by Ingo Comment on The MACL extended attribute by hoakley On Reflection: Cézanne Privacy: Which folders are protected in Tahoe? Last Week on My Mac: Root cause analysis and ClickFix Last Week on My Mac: Root cause analysis and ClickFix Last Week on My Mac: Root cause analysis and ClickFix Last Week on My Mac: Root cause analysis and ClickFix Why you can’t trust Privacy & Security How can I now have two apps named Pages? How to survive the loss of Rosetta Use Fallback Recovery on Apple silicon Macs Clean install macOS
Which tasks require mains power?
hoakley · 2026-05-27 · via Comments for The Eclectic Light Company

With extended running time on battery and fast charging, your MacBook Air or MacBook Pro probably doesn’t spend long on mains (AC) power. What you may not have realised is that it does require mains power to perform some tasks, so there are benefits to periodically leaving it awake and running when connected to a mains power supply, to allow it time to catch up on those. This article examines the benefits.

Background tasks

If you look through the property lists used for macOS LaunchDaemons and LaunchAgents you’ll come across two keys used for their activities and background services that determine whether they run when powered by battery alone:

  • AllowBattery is set to true when the service can be run on battery, or to false when it can’t;
  • RequiresExternalPower, its converse, is set to true when it can’t be run on battery, or to false when it can.

Unfortunately Apple doesn’t explain either of these, and they’re omitted from the last systematic account of those property lists, which was last revised ten years ago. Neither are they mentioned in man launchd.plist. There is evidence, though, that they may not both apply to macOS. For XPC activities there’s a global variable XPC_ACTIVITY_ALLOW_BATTERY, whose default value is false for activities with a maintenance priority, but is true for utility priority activities. However, requiresExternalPower is normally used for Background Tasks in iOS/iPadOS/etc., and thus doesn’t appear to apply to macOS. Clear, up to date documentation would be very helpful, please, Apple.

Of the 878 property lists in /System/Library/LaunchAgents and LaunchDaemons in macOS 26.5, 47 set a value for the AllowBattery key, and many more assign maintenance priority to activities. Among the activities and services that appear unlikely to run when on battery alone are:

  • com.apple.corespotlightd.updateContacts in corespotlightd, which presumably updates search information for Contacts’ database;
  • com.apple.calendar.daemon.databasecleanup, performing maintenance on Calendar databases;
  • com.apple.cloudphotod.maintenance, performing maintenance on iCloudPhotos;
  • com.apple.photoanalysisd.backgroundanalysis and several other photoanalysisd services, used to analyse media content, particularly for indexing by Spotlight;
  • com.apple.photolibraryd.periodicmaintenance, performing maintenance on Photos libraries;
  • com.apple.Safari.SafeBrowsing.BrowsingDatabases.Update, updating Safari’s Safe Browsing databases.

Of these the most noticeable are photoanalysisd services, which can flood the E cores when a laptop Mac is left connected to mains power, particularly when many images have been added or modified since the last session on mains. Those can in turn trigger copious Spotlight indexing activity with mds and related processes.

XProtect Remediator

Regular scans performed by XProtect Remediator (XPR) to detect and remove known malicious software can busy a whole E core for well over half an hour, and are accompanied by intense disk activity. Because of that, some of its services will only be run when a Mac is powered by mains.

Current property lists in XPR call for three types of scan:

  • Fast scan, run every 6 hours, when AllowBattery is set to true;
  • Regular scan limited by a timer, run every 24 hours, AllowBattery false;
  • Slow scan without any time limit, run every 7 days, AllowBattery false.

You should therefore expect daily XPR scans only to take place when your laptop is awake and connected to power. Fast scans don’t result in any of the distinctive reports from scan modules that are checked by utilities like XProCheck and SilentKnight, and appear to pass unrecorded in the log.

You can observe this yourself after starting your Mac up for the day. If it’s running on mains power and left alone for 10-15 minutes, XPR will usually start scanning with each of its modules. However, if you start your Mac up on battery and leave it for a couple of hours, there’s no sign of those scans starting.

Sparse bundles

Sparse bundles (disk images that store files inside a bundle folder rather than in a single file) need to be compacted occasionally to ensure they don’t grow larger than they need. Because compaction can take a long time and can’t be interrupted without risking the whole sparse bundle’s contents, by default it won’t be performed when a Mac is running on battery power. That can be overridden in some utilities like my own Spundle, and in the hdiutil command.

Catching up

If your MacBook Air or Pro spends much of its waking life running on battery, it’s a good idea to give it a break every few days by leaving it awake and powered from its mains adaptor for an hour or two. How often you should do that is more flexible. If you like to run a regular routine, scheduling it every 2-3 days should be sufficient, with a minimum frequency of once a week. An ideal routine for a laptop in frequent heavy use might be for a daily break at lunchtime.

If you want to tailor this more to demand, observe how long your laptop is running heavy loads from photoanalysisd and others when it’s taking a break on mains power, and adjust the frequency of those breaks until those periods of heavy load are sufficiently brief to fit in with your schedule.

These will also ensure your Mac gets at least one complete scan by XProtect Remediator each week.

I’m grateful once again to Michele for raising this question.