解析方法
这份说明把「满电到底怎么算的」讲清楚,方便你判断结果可不可信。
1. 数据来源
iPhone 会在系统分析日志里记录电池管理信息。路径是「设置 → 隐私与安全性 → 分析与改进 → 分析数据 → log-aggregated-*.ips」。你把它导出并通过文件选择器交给满电,App 只读这一份文件。
2. 两种日志格式
- JSON 格式:较新的 iOS 版本,头部有元信息,主体是嵌套的字典。按精确键名取值。
- 老式文本格式:更早的版本或某些机型,用正则从文本里兜底提取
last_value_*系列字段。
两条路径都跑,谁先拿到完整字段就用谁;如果一份文件里完全没有电池字段,会明确报「文件读到了,但里面还没有电池字段」,而不是猜一个数字。
3. 字段优先级
容量字段在不同系统版本里名字不一样,取值顺序是:
AppleRawMaxCapacity—— 首选,原始最大容量NominalChargeCapacity—— 兜底,标称容量
循环次数取 CycleCount,设计容量取 DesignCapacity。几个字段谁先出现不影响结果。
4. 健康度
健康度 = 最大容量 ÷ 设计容量 × 100%,保留一位小数,并标注 ±0.6% 的估算区间。它不是 Apple 电池健康页面的复制品——同一天读出来的值可能略有差异,因为两者的采样来源不同。
5. 置信度
- 高:样本 ≥ 8 条,且跨度 ≥ 60 天
- 中:样本 ≥ 3 条,且跨度 ≥ 7 天
- 低:其余情况
6. 换电预测
取最近 90 天的样本做最小二乘线性回归,外推到健康度 80% 的那一天,并给出一个区间(下界与上界)。以下情况宁可不给结论:
- 近 90 天样本少于 3 条
- 斜率不够负(电池没有在掉)
- 推算结果落在 10 年之外
样本不足时页面会直接写「先记录几周,再谈预测」——不吓人,是我们对这个功能的底线。
7. 我们不做什么
- 不读取屏幕使用时间、不估算充电功率、不接入任何外部接口
- 不联网比对机型参数,所有阈值写在本机
- 不修改你的原始日志,解析完只留下结果
8. 已知边界
- 不同 iOS 版本的字段名存在差异,极老的系统可能读不到电池字段
- 日志只记录到导入那一刻之前的状态,之后的变化需要重新导入
- 温度字段并非每条日志都有,缺失时周报会跳过相关结论
Method
This page explains how Mandian does its math, so you can judge how much to trust the numbers.
1. Where the data comes from
iOS records battery-management details in its analytics logs: Settings → Privacy & Security → Analytics & Improvements → Analytics Data → log-aggregated-*.ips. You export that file and hand it to Mandian through the file picker; the app reads only that one file.
2. Two log formats
- JSON — newer iOS versions. Metadata in the header, nested dictionaries in the body. Values are read by exact key.
- Legacy text — older versions or certain models. Regular expressions pull the
last_value_*family out of the text as a fallback.
Both paths run; whichever yields a complete set of fields wins. If a file contains no battery fields at all, the app says so explicitly rather than inventing a number.
3. Field priority
Capacity fields are named differently across OS versions. Priority order:
AppleRawMaxCapacity— preferred, the raw maximum capacityNominalChargeCapacity— fallback, the nominal capacity
Cycle count comes from CycleCount, design capacity from DesignCapacity. The order in which fields appear in the file does not change the result.
4. Health
Health = max capacity ÷ design capacity × 100%, to one decimal, shown with a ±0.6% margin. It is not a copy of Apple's Battery Health screen — readings taken on the same day can differ slightly because the two use different sources.
5. Confidence
- High: at least 8 samples spanning 60+ days
- Medium: at least 3 samples spanning 7+ days
- Low: anything else
6. Replacement forecast
The last 90 days of samples are fitted with a least-squares line and projected to the day health reaches 80%, with a range around it. Mandian deliberately stays silent when:
- fewer than 3 samples in the last 90 days,
- the slope is not negative enough (the battery isn't declining), or
- the projection lands more than 10 years out.
When samples are thin, the screen simply says "record a few more weeks first" — not scaring people is the whole point.
7. What we don't do
- No Screen Time reading, no charger-wattage estimation, no external API calls.
- No online model lookups — every threshold is built into the app.
- Your original logs are never modified; only the results are kept.
8. Known limits
- Field names differ across iOS versions; very old systems may expose no battery fields.
- A log only reflects the state up to the moment you imported it.
- Not every log contains a temperature field; the weekly report skips that conclusion when it is missing.