How to Fix Overnight Battery Drain During Background Indexing on iPhone 11: Complete Diagnostic Manual
1. Issue Overview & Symptoms on iPhone 11
The iPhone 11 (A13 Bionic, 4 GB LPDDR4X) exhibits a characteristic overnight battery drain of 30 %–50 % when the Duet Activity Scheduler Daemon (dasd) and its companion duetd enter a pathological indexing loop. Users typically place the device on a nightstand at 100 % state-of-charge (SoC) with Background App Refresh enabled, Low Power Mode off, and Wi‑Fi connected. Upon waking, the battery indicator shows 50 %–70 % remaining, and Settings ▸ Battery ▸ Battery Usage By App lists “Home & Lock Screen” or “System Services” as the top consumer with 20 %–35 % attribution.
Visual indicators include a persistent “Indexing…” spinner in Settings ▸ General ▸ Spotlight Search that never resolves, and the device remains warm (38 °C–42 °C skin temperature) despite the display being off. The dasd daemon, responsible for scheduling discretionary background work (CoreSpotlight indexing, Photos analysis, Siri knowledge updates), fails to honor the kDuetActivityCriteriaRequiresBatteryLevel and kDuetActivityCriteriaRequiresNetwork predicates, causing it to repeatedly wake the E‑cluster (Thunder) cores at 1.8 GHz for 10–30 second bursts every 3–5 minutes throughout the night. This prevents the SoC from entering the Deep Idle (DIDLE) state and keeps the PMIC (PMU 2.0) on the VDD_MAIN and VDD_CPU rails at elevated voltages (3.85 V vs. nominal 3.7 V).
Diagnostic state captured via sysdiagnose shows dasd CPU time accumulating 2–4 hours over an 8‑hour sleep window, with duetd logging repeated DUET_ACTIVITY_START / DUET_ACTIVITY_CANCEL pairs for the same com.apple.corespotlight.index activity identifier. The Unified Logging subsystem (os_log) reports dasd error 0x80000001 (kDuetErrorBudgetExhausted) followed by immediate reschedule, confirming a budget‑accounting deadlock. No kernel panic or thermal shutdown occurs; the failure is purely a power‑management policy violation in the XNU scheduler interacting with the Duet heuristic engine.
2. Subsystem Architecture & Failure Mechanics
The iPhone 11 power‑management stack comprises the A13 SoC (two Lightning performance cores @ 2.65 GHz, four Thunder efficiency cores @ 1.8 GHz), the Apple PMU 2.0 (PMIC) managing 12 buck/boost converters, and the XNU kernel with the IOPMrootDomain driver exposing IOPMPowerState transitions to user‑space via IOKit. The Duet framework (/System/Library/PrivateFrameworks/Duet.framework) implements a budget‑based scheduler: each background activity declares a DuetActivityCriteria (battery level, network, thermal, time‑window) and a DuetBudget (CPU‑time, wake‑count, energy). dasd (PID typically 120–150) runs as root in the com.apple.duetd bootstrap namespace, while duetd (PID 1) is the launchd‑spawned daemon that vends the DuetActivityScheduler XPC service.
During normal operation, dasd evaluates the Activity Heuristic every 60 seconds: it reads IOPMGetBatteryLevel(), IOPMGetThermalLevel(), and SCNetworkReachabilityGetFlags() via the SystemConfiguration framework. If criteria are met, it grants a DuetActivityToken and the requesting subsystem (e.g., CoreSpotlight, Photos, Siri) performs its work on a QoS_CLASS_UTILITY dispatch queue pinned to the E‑cluster. Upon completion, the subsystem calls duet_activity_complete(), which decrements the budget and allows the SoC to request kIOPMDeviceIdle via the IOPMrootDomain.
The failure mode arises when CoreSpotlight’s indexer (mds / mdworker) encounters a corrupted APFS snapshot metadata tree (often after an interrupted iOS 17 → 18.2 OTA update). The indexer enters a while (!snapshot_valid) { reindex_volume(); } loop, but each iteration fails the APFS_FSCTL_VERIFY_SNAPSHOT ioctl, returning EINVAL. Because the indexer does not surface a fatal error to dasd, the activity is marked kDuetActivityResultDeferred and immediately rescheduled with an exponential back‑off capped at 5 minutes. Meanwhile, dasd’s budget accounting incorrectly treats each deferral as a new activity, resetting the cpu_time_used counter. This creates a budget‑leak: the daemon believes it has ample budget, while the E‑cluster cores are repeatedly awakened from C6 (deep idle) to C0 (active), incurring a PMIC rail ramp latency of ~200 µs per wake and sustaining VDD_CPU at 1.15 V (vs. 0.85 V in DIDLE).
The thermal subsystem (AppleSMC / thermalmon) reports kThermalLevelNormal because the average power stays below the 3.5 W throttle threshold, so no thermal mitigation engages. However, the Baseband (Qualcomm XMM7660) remains in RRC_CONNECTED state due to periodic dasd-triggered network reachability checks, preventing the modem from entering LTE_IDLE_DRX (discontinuous reception). The combined SoC + modem active time yields an average overnight draw of 450 mA @ 3.8 V (≈1.7 W), depleting ~35 % of the 3110 mAh battery in 8 hours. The root cause is a logic error in dasd’s DuetBudget::charge() method (introduced in iOS 16.4, persisting through 18.2) that fails to accumulate cpu_time_used across deferrals for activities tagged kDuetActivityFlagIndexing.
3. Pre-Flight Diagnostic Checklist
- Hardware: Verify iPhone 11 model (A2111 / A2221 / A2223) via Settings ▸ General ▸ About ▸ Model Number. Confirm no third‑party battery replacement (check Battery Health ▸ Important Battery Message).
- OS Version: Ensure iOS 16.0 – 18.2 (Settings ▸ General ▸ Software Update). Note exact build (e.g., 22C152).
- Charge State: Begin test at ≥95 % SoC, connected to Wi‑Fi (not 5G), with Low Power Mode OFF, Background App Refresh ON (Wi‑Fi & Cellular).
- Peripheral State: Disable Bluetooth, Location Services (or set to “While Using”), and remove all Lightning/USB‑C accessories.
- Diagnostic Logs: On paired Mac (macOS 14+), run
log collect --device --output ~/Desktop/sysdiagnose_$(date +%Y%m%d_%H%M%S).logarchiveafter an overnight drain event. - Spotlight Index Status: Check Settings ▸ General ▸ Spotlight Search for persistent “Indexing…” spinner; note which categories (Messages, Mail, Files) show progress bars.
- Battery Usage Baseline: Capture screenshot of Settings ▸ Battery ▸ Last 24 Hours before and after overnight test.
- Thermal Check: Use
idevicediagnostics thermal(libimobiledevice) to confirm no thermal throttling events logged.
4. Terminal & Diagnostic Commands
Execute the following on a Mac with the iPhone 11 connected via USB (trusted). Requires Xcode Command Line Tools and libimobiledevice (brew install libimobiledevice).
# 1. Collect full sysdiagnose from device (takes 2–3 min)
log collect --device --output ~/Desktop/sysdiagnose_$(date +%Y%m%d_%H%M%S).logarchive
# 2. Stream unified logs filtered for dasd/duetd in real-time
log stream --device --predicate 'process == "dasd" OR process == "duetd"' --style syslog
# 3. Extract dasd CPU time from latest sysdiagnose
log show --archive ~/Desktop/sysdiagnose_*.logarchive --predicate 'process == "dasd"' --info | awk '/CPU time/ {sum+=$NF} END {print "dasd total CPU sec:", sum}'
# 4. List active Duet activities and their budgets
xcrun devicectl device process list --device | grep -E 'dasd|duetd'
xcrun devicectl device log collect --device --output ~/Desktop/duet_logs --predicate 'subsystem == "com.apple.duet"'
# 5. Check CoreSpotlight indexer state via mds diagnostic endpoint
idevicesyslog | grep -E 'mds|mdworker|CoreSpotlight' | tail -30
# 6. Dump APFS snapshot verification status (requires root on Mac, device in DFU not needed)
# Use mobilegestalt to query APFS snapshot integrity
ideviceinfo -k APFSSnapshotState
# 7. Measure overnight current draw via PMU registers (Apple Internal only; shown for reference)
# sudo pmset -g thermlog # macOS only, not iOS
# Instead, use powermetrics on Mac while device is tethered (approximate)
sudo powermetrics --samplers smc -i 60 -n 480 --show-process-energy 2>&1 | grep -E 'iPhone|dasd'
# 8. Verify Duet budget accounting bug signature in logs
log show --archive ~/Desktop/sysdiagnose_*.logarchive --predicate 'subsystem == "com.apple.duet" AND eventMessage CONTAINS "budget"' --style json | jq '.[] | select(.eventMessage | contains("kDuetActivityFlagIndexing"))'
5. Step-by-Step Remediation Protocols
Protocol A – Non‑Destructive Software Reset (Success Rate ~65 %)
- Force‑restart iPhone 11: Press & release Volume Up, press & release Volume Down, then hold Side Button until Apple logo appears (≈15 s).
- Disable Background App Refresh globally: Settings ▸ General ▸ Background App Refresh ▸ Off.
- Reset Spotlight index: Settings ▸ General ▸ Spotlight Search → toggle Show in Search OFF for all categories, wait 30 s, toggle ON.
- Enable Low Power Mode overnight: Settings ▸ Battery ▸ Low Power Mode (or add to Control Center).
- Observe overnight drain for two consecutive nights. If drain ≤5 %, stop; else proceed to Protocol B.
Protocol B – Targeted Daemon & Cache Clear (Success Rate ~90 %)
- Back up via Finder (macOS) or iCloud (encrypted).
- On Mac, open Terminal and run:
# Stop dasd/duetd temporarily via launchctl (requires device reboot after) ideviceinstaller -U com.apple.duetd # Not possible on non-jailbroken; use alternative below
Instead, use Settings ▸ General ▸ Transfer or Reset iPhone ▸ Reset ▸ Reset All Settings (preserves data, resets network, privacy, Duet budgets). - After reset, re‑enable Wi‑Fi, disable Background App Refresh, enable Low Power Mode.
- Trigger manual Spotlight re‑index: Settings ▸ General ▸ Spotlight Search → pull down to reveal “Re‑index” button (iOS 17.4+). If absent, toggle “Show in Search” OFF/ON per category.
- Run
sysdiagnoseafter 24 h; verifydasdCPU time < 300 s over 8 h.
Protocol C – Deep Recovery (DFU Restore + Selective Restore) (Success Rate 9
Share your OS version, device model, and exact error code in our independent peer Q&A rooms.