iPhone 4配置文件功耗(带仪器) [英] iPhone 4 profile power consumption (with instruments)
问题描述
我有一个应用程序,我添加了很多动画。该应用程序还使用iPhone睡眠防护器播放静音。从那时起,我注意到电池消耗增加了4倍!我想找一种方法来分析功耗(我认为我在仪器中看到了一个选项)来查找和消除违规方法。
I have an app that I added a lot of animation to. The app also used "iPhone sleep preventer" to play silent audio. Since then, I noticed that the battery consumption increased by up to 4 times! I'd like to find a method to profile the power consumption (I think I saw an option in Instruments) to find and eliminate the offending method(s).
我会从哪里开始寻找这样的信息?目前我将电话留在桌面上约3个小时,以记录随着时间的推移功耗。如果连续运行我的应用程序,是否有更好的方法可以预测应用程序何时耗尽电量?
Where would I start looking for information like this? Currently I have the phone left on the desk for ~3 hours to record power drain over time. Is there a better method to predict when the app will run out of power if running my app continuously?
一个额外的问题:是否剩余的电池百分比显示在状态栏是线性的还是在电池寿命结束时有一些非线性?
An extra side question: are the % of battery left displayed in the status bar linear or is there some non-linearity towards the end of the battery life?
编辑:我在xcode> product>中找到了power预设配置文件> CPU>能量诊断。它似乎无法正常工作,因为功耗级别始终为0/20。但它确实告诉我在 app前景,图形和音乐上花了多少CPU时间!
I found a "power" preset in xcode>product>profile>CPU>Energy diagnostics. It doesn't seem to work perfectly, as the power consumption level is always 0/20. But it does tell me how much of the CPU time is spent on app foreground, graphics and music!
现在我不知道CPU是怎么回事电源管理,运行CPU的能耗比75%高出75%?直观地感觉它应该... ...
Now I dont know how the CPU power is managed, is running the CPU at 75% more power consuming than lets say 30%? Intuitively it feels like it should...
谢谢!
推荐答案
<我不是专家。事实上,我今天才开始对iphone进行配置,并在此处查看了你的问题,希望不要学习。
I'm no expert. Im fact I am only starting to power profile a iphone today, and looked upon your question here in hope off learning.
所以我将分享我在与此同时。
在 IOS开发人员库中,我发现了以下内容:
So I will share with what I've found in meanwhile. On IOS Developer Library I have found the following:
- 将设备连接到您的开发系统。
- 启动Xcode或Instruments。
- 在设备上,选择设置>开发人员并打开电源记录。
- 断开设备并执行所需的测试。
- 重新连接设备。
- 在仪器中,打开Energy Diagnostics模板。
- 选择文件>从设备导入能量诊断。
- Connect the device to your development system.
- Launch Xcode or Instruments.
- On the device, choose Settings > Developer and turn on power logging.
- Disconnect the device and perform the desired tests.
- Reconnect the device.
- In Instruments, open the Energy Diagnostics template.
- Choose File > Import Energy Diagnostics from Device.
您在日志记录期间有一份Cpu和能源报告。
您可以在 IOS Dev的这一部分。 lib。
And you have a report of Cpu and energy during the time of the log. You can find this steps and many more info on this section of the IOS Dev. lib.
我对此事情仍然有点新鲜,所以如果您发现任何您认为有意义的内容,请在此处发布该信息。
I am still a bit fresh on this matter, so if you find anything that you think is meaningful please post that info here.
编辑:苹果开发者遭遇了一些变化。更新了链接
The apple dev lib suffered some changes. Updated link
这篇关于iPhone 4配置文件功耗(带仪器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!