简体   繁体   English

iPhone电池耗尽问题

[英]iPhone battery drain issue

I think my question will be useful for others. 我认为我的问题对其他人有用。 I have battery drain issue and want to find out where it is. 我有电池耗尽问题,想知道它在哪里。

I use xcode instruments: Enter profile 我使用xcode工具:输入个人资料 在此输入图像描述 then Energy Diagnostics, but I see nothing in energy usage section. 然后是Energy Diagnostics,但我在能源使用方面没有看到任何内容。 在此输入图像描述

How can I enable information in Energy Usage section? 如何在“能源使用”部分中启用信息?

Energy profiling is a bit more tricky. 能量分析有点棘手。 You need to: 你需要:

  1. Enable energy logging via the device's developer settings 通过设备的开发人员设置启用能源记录
  2. Disconnect device from ANY power source (this of course means that you can't see the stats live in instruments) 从任何电源断开设备(这当然意味着您无法在仪器中看到统计数据)
  3. Start logging via the device developer settings 通过设备开发人员设置开始记录
  4. Perform the actions you wish to profile 执行您想要分析的操作
  5. Stop logging via the device developer settings 通过设备开发人员设置停止记录
  6. Connect device to Mac, open instruments and select File->Import logged data from device 将设备连接到Mac,打开仪器并选择文件 - >从设备导入记录的数据

Now you'll see the energy usage statistics. 现在您将看到能源使用情况统计数据。

You can also try to log the power consumption programatically. 您还可以尝试以编程方式记录功耗。

Several ways of doing this can be found in the BatteryChart project: https://github.com/nst/BatteryChart 有几种方法可以在BatteryChart项目中找到: https//github.com/nst/BatteryChart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM