xcode iPhone电池耗尽问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14151152/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iPhone battery drain issue
提问by Paul T.
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
then Energy Diagnostics, but I see nothing in energy usage section.
我使用 xcode 工具:输入配置文件,然后输入
能源诊断,但我在能源使用部分看不到任何内容。
How can I enable information in Energy Usage section?
如何在能源使用部分启用信息?
采纳答案by Stavash
Energy profiling is a bit more tricky. You need to:
能量分析有点棘手。你需要:
- Enable energy logging via the device's developer settings
- Disconnect device from ANY power source (this of course means that you can't see the stats live in instruments)
- Start logging via the device developer settings
- Perform the actions you wish to profile
- Stop logging via the device developer settings
- Connect device to Mac, open instruments and select File->Import logged data from device
- 通过设备的开发者设置启用能量记录
- 断开设备与任何电源的连接(这当然意味着您无法看到仪器中的实时统计数据)
- 通过设备开发者设置开始记录
- 执行您希望配置文件的操作
- 通过设备开发者设置停止记录
- 将设备连接到 Mac,打开仪器并选择文件->从设备导入记录的数据
Now you'll see the energy usage statistics.
现在您将看到能源使用统计数据。
回答by Chad Adams
Did you enable energy logging on your iPad?
您是否在 iPad 上启用了能量记录?
回答by nst
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