Battery Life

RSS for tag

Measure how your application consumes energy.

Posts under Battery Life tag

145 Posts

Post

Replies

Boosts

Views

Activity

How to measure energy usage in Xcode 13 / iOS15?
I'd like to confirm the battery usage of an app I am developing on iOS, specifically on Xcode 13 and iOS 15. (Note: This app previously showed no issues with battery usage on previous versions of iOS.) Previously, it seems that there were two ways to gather energy usage information: #1. On the device under Settings > Developer > Logging As per Apple's documentation described in the section titled "Log Energy Usage Directly on an iOS Device". However, on iOS15, I can't find any options for logging under Developer or anywhere under settings even when searching. #2. Profiling via Instruments using the "Energy Log" template As per the same documentation from Apple described in the section "Use the Energy Diagnostics Profiling Template". While it is still available in Xcode 12, this template is missing in Xcode 13. Naturally, it's also not possible to profile an iOS15 device with Xcode 12. Digging through the Xcode 13 release notes, I found the following: Instruments no longer includes the Energy template; use metrics reporting in the Xcode Organizer instead. (74161279) When I access the Organizer in Xcode (12 or 13), select an app and click "Energy" for all versions of the app, it shows the following: Apple's documentation for "Analyzing the Performance of Your Shipping App" says: "In some cases the pane shows “Insufficient usage data available,” because there may not be enough anonymized data reported by participating user devices. When this happens, try checking back in a few days." Well over a year into production and having sufficient install numbers, I have a feeling that waiting a few days might not do much. I would like to determine if this is a bug in my app or a bug in iOS15. How can energy usage data be gathered using Xcode 13 on iOS 15?
6
1
8.4k
Jun ’23
add new feature on Location access which save lots of battery length and battery life
A new feature in Settings > privacy & Security> Location Services that allows users to disable location access for all installed 3rd party applications. I think this is a great idea. It would save battery life and improve privacy for users. It would also be helpful for tracking kids and teenagers, as well as for people with Alzheimer's or dementia and syndrome down people. Apple and Google should store children and teenagers' school locations on their Apple or Google accounts. I think this is a good idea, but I don't think it should be mandatory. Parents should have the option of whether or not to share their child's school location. this helps to protect our teenagers to be safe. Apple should distinguish between known locations, such as home, work, and school. This would be a helpful feature for apps that need to know where the user is located. For example, a delivery app or Amazon iOS App could use this information to let the user know when their package is expected to arrive. Apple should create a Location Known Kit for Location access. This would allow apps to share location information with each other. and there is no need to check over and over by different 3rd party who installed multiple and different applications to check the Locations over and over and it's a disaster that if users are at home or at workplace or at school most majority of the time. please note above new enhancement might help a lot of Apple home and Google Home's routine and automation feature to make them possible This would save battery life and improve performance. I think these are all great ideas. I hope that Apple will consider implementing them in future versions of iOS and iPadOs and Watch OS. Thanks in advance. Best Pooya Mohammadhossein Pooya M
1
0
1k
Jun ’23
Battery health dropping
I bought my iPhone 14,7 months ago and it has dropped 4% during April and May.My phone battery dropped from 97% percent to 96% just 3 days apart in May.I am new apple user so can someone please explain me and explain how I can avoid more battery dropping and how to fix it.Thank you!
0
0
639
May ’23
Battery Health drainage in 11 Pro
Few weeks ago, everything was going good. My battery health was 86%. Don’t know why my IPhone 11 pro starts heating up during charging and its battery health reduced to 82% in just 3 weeks. Can anyone let me whats going on with it as I am using Apple 20 watt charger with it. Then whats the problem and what should I do?
1
0
697
Apr ’23
If statement not working on shortcuts iOS 16.2
i used to have shorts where my phone goes into lower power mode on its own when it reaches 20% and that it will remind me to unplug once battery status reaches 90%. But now I am not able to do that as the if statement does jot have the conditions that it used to have before. I used the if equal to, if lesser than, if greater than features for these shortcuts of mine. Now all I see are two conditions that basically only checks for value. Which again makes no sense because your battery status will always have a value ranging from 0-100. So how do I solve this I don’t know. The conditons need to come back!
1
1
1.7k
Apr ’23
Battery health got low fast
So I got my phone like 3 months ago in December 12 from not authorized apple store, we dont have as i think, and it got to 96% on past month and now when I looked it has 90%. I wasnt charging from 0-100, it was 20-90 always, like I didn't treat my old iphone 7 that well and it was absolutely 2 years of heaven. only differences between them are that this one is factory changed iPhone XS and old one was with real iPhone factory made materials and didnt charged anything, SO IS this problem that I have bad battery or the phone is badly factory upgraded. tell me what to do in reply's thanks and have fun.
0
0
905
Mar ’23
Correct way to read out information about current energy usage battery&charger/adapter
I'm looking for a way to read out the current energy drain of various macOS devices that should be backwards compatible at least to macOS 12. So far I already had a couple of good idea – well initially I thought so – to get that data from ioreg or IOKit, reading out AppleSmartBattery object. I'm trying to write a small program in Rust that collects the energy usage of our companies macOS devices and record this how much happened while in the office and how much on the road. Therefore I need to consider cases where the battery is charging as well as the battery is full and energy is drawn from the power adapter or usb-c connected display directly via PD. So far I was able to read the desired data out via ioreg with plist output and parse the information into a struct. The issue I have testing this out that my 1st approach of going for PowerTelemetryData which would be perfect is only available on macOS 13+ systems. The second approach reading out the subobjects of BatterData and PowerOutDetails seem to only be available on macOS 12 devices now and then. Any suggestions or hints?
1
0
1.3k
Feb ’23
What does the number key means in log-power-timestamp.session
I get a log-power session from my iPhone analyze, I want to know the power consuming of my app, power_metrics as below: "power_metrics" : { "network_io" : { "cellular" : { "totalUpload" : 4478468, "totalDownload" : 223284091 }, "wifi" : { "totalUpload" : 195605789, "totalDownload" : 1233202961 } }, "display_apl" : { "totalFrameCount" : 209019, "averagePixelLuminance" : 38 }, "app_energy" : { "bg_audio" : { "10" : 563, "6" : 70, "4" : 25, "2" : 26, "7" : 236, "11" : 577 }, "bg" : { "10" : 15501, "6" : 1931, "4" : 689, "2" : 725, "7" : 6504, "11" : 15878 }, "fg" : { "7" : 137056, "3" : 3069, "11" : 334589, "4" : 14555, "1" : 505774, "6" : 40718, "2" : 15294, "10" : 326637 }, "total" : { "7" : 143797, "3" : 3069, "11" : 351045, "4" : 15270, "1" : 505774, "6" : 42720, "2" : 16046, "10" : 342702 } }, "app_time" : { "GPU" : 503, "CPU" : 2479, "bg_unplugged" : { "audio" : 6, "location_audio" : 0, "total" : 171, "location" : 0 }, "fg_total" : 3492, "fg_unplugged" : 3492, "cellular_condition" : { "signalBarUnknown" : 0, "signalBar1" : 91, "signalBar0" : 0, "signalBar4" : 2282, "signalBar3" : 1060, "signalBar2" : 341 }, "bg_total" : { "audio" : 6, "location_audio" : 0, "total" : 171, "location" : 0 } } }, The key 10, 6, 4, 2, 7, 11 means what? "10" : 563, "6" : 70, "4" : 25, "2" : 26, "7" : 236, "11" : 577
1
0
1.8k
Feb ’23
Improving battery reading when the machine wakes.
I am using the CFProperty "AppleRawCurrentCapacity" value from IOServiceGetMathcingService( kIOMainPortDefault, IOServiceMatching( "AppleSmartBattery" ) ) to obtain the mAh value of the MacBook's battery. Once when the app receives the NSWorkspace notification of display sleep, and once again when receiving the NSWorkspace notification of display wake. I then calculate how much battery was expended during sleep by deducting the pre value from post value. The results can wildly vary, from it using 16 mAh per hour, to gaining 10 mAh an hour (without being plugged in). Sometimes a 10 hour sleep doesn't use any mAh... Which is clearly wrong. When my app detects the key kIOPMPSInvalidWakeSecondsKey is present, I set a timer for that period + 3 seconds and attempt to read the battery values again. Yet the results can still wildly vary. I see on Intel Macs there is a kIOPMPSMaxErrKey (set to 9 on a 2019 16"), however I don't see this on M1, and don't know how it can help, if it does exist. Can anyone give me any pointers as to what I am doing wrong, or in the direction of obtaining reliable mAh values? I like mAh as it's more precise that the standard integer values of 0 - 100, but I don't have to stick with mAh, I'd just don't like reporting that a 16 hour sleep didn't use any battery, when I know it's not true. Thanks
1
0
1.4k
Jan ’23
iPhone 13 Battery Health
Hi, I’ve had my iPhone 13 for a little more than a year at this point and i checked my battery health to check where it was at. To my surprise, it had dropped 9% to now only be at 91% battery health. After doing research on what might have caused that I noticed a recurring theme about 5g having an effect on my battery health. I just wanted to verify what could be causing the fast deterioration of my battery health and if there’s anything I can do to slow down the loss of the battery.
1
0
974
Dec ’22
Bartery Health drain
I’ve had my iPhone since July and my battery health has stayed at 99% for a good while now yesterday I checked it was the exact same but today when I checked it went down to 96% we have cold weather here but could it be due to cold weather even though I had my phone in my pocket during the entire time?
1
0
1k
Nov ’22
Battery performance poor in iPhone 14 pri
I’m not a developer but I really wanted to reach you out to raise a concern. When the launch of iPhone 14 pro happened it was advertised as 30-40% increase in battery performance due to the changes in hardware. Unfortunately the battery is draining 2x as fast as iPhone 13 Pro and iPhone 12 which is incredibly disappointing. Please do not do false marketing on your product if the feature is fully developed. I bought this phone for 1600$ and this is what I get. Please fix this. Battery backup is the most important thing rather than the focused features such as dynamic island and always on Display
1
0
963
Oct ’22
How to measure energy usage in Xcode 13 / iOS15?
I'd like to confirm the battery usage of an app I am developing on iOS, specifically on Xcode 13 and iOS 15. (Note: This app previously showed no issues with battery usage on previous versions of iOS.) Previously, it seems that there were two ways to gather energy usage information: #1. On the device under Settings > Developer > Logging As per Apple's documentation described in the section titled "Log Energy Usage Directly on an iOS Device". However, on iOS15, I can't find any options for logging under Developer or anywhere under settings even when searching. #2. Profiling via Instruments using the "Energy Log" template As per the same documentation from Apple described in the section "Use the Energy Diagnostics Profiling Template". While it is still available in Xcode 12, this template is missing in Xcode 13. Naturally, it's also not possible to profile an iOS15 device with Xcode 12. Digging through the Xcode 13 release notes, I found the following: Instruments no longer includes the Energy template; use metrics reporting in the Xcode Organizer instead. (74161279) When I access the Organizer in Xcode (12 or 13), select an app and click "Energy" for all versions of the app, it shows the following: Apple's documentation for "Analyzing the Performance of Your Shipping App" says: "In some cases the pane shows “Insufficient usage data available,” because there may not be enough anonymized data reported by participating user devices. When this happens, try checking back in a few days." Well over a year into production and having sufficient install numbers, I have a feeling that waiting a few days might not do much. I would like to determine if this is a bug in my app or a bug in iOS15. How can energy usage data be gathered using Xcode 13 on iOS 15?
Replies
6
Boosts
1
Views
8.4k
Activity
Jun ’23
add new feature on Location access which save lots of battery length and battery life
A new feature in Settings > privacy & Security> Location Services that allows users to disable location access for all installed 3rd party applications. I think this is a great idea. It would save battery life and improve privacy for users. It would also be helpful for tracking kids and teenagers, as well as for people with Alzheimer's or dementia and syndrome down people. Apple and Google should store children and teenagers' school locations on their Apple or Google accounts. I think this is a good idea, but I don't think it should be mandatory. Parents should have the option of whether or not to share their child's school location. this helps to protect our teenagers to be safe. Apple should distinguish between known locations, such as home, work, and school. This would be a helpful feature for apps that need to know where the user is located. For example, a delivery app or Amazon iOS App could use this information to let the user know when their package is expected to arrive. Apple should create a Location Known Kit for Location access. This would allow apps to share location information with each other. and there is no need to check over and over by different 3rd party who installed multiple and different applications to check the Locations over and over and it's a disaster that if users are at home or at workplace or at school most majority of the time. please note above new enhancement might help a lot of Apple home and Google Home's routine and automation feature to make them possible This would save battery life and improve performance. I think these are all great ideas. I hope that Apple will consider implementing them in future versions of iOS and iPadOs and Watch OS. Thanks in advance. Best Pooya Mohammadhossein Pooya M
Replies
1
Boosts
0
Views
1k
Activity
Jun ’23
Battery health dropping
I bought my iPhone 14,7 months ago and it has dropped 4% during April and May.My phone battery dropped from 97% percent to 96% just 3 days apart in May.I am new apple user so can someone please explain me and explain how I can avoid more battery dropping and how to fix it.Thank you!
Replies
0
Boosts
0
Views
639
Activity
May ’23
Battery Health drainage in 11 Pro
Few weeks ago, everything was going good. My battery health was 86%. Don’t know why my IPhone 11 pro starts heating up during charging and its battery health reduced to 82% in just 3 weeks. Can anyone let me whats going on with it as I am using Apple 20 watt charger with it. Then whats the problem and what should I do?
Replies
1
Boosts
0
Views
697
Activity
Apr ’23
If statement not working on shortcuts iOS 16.2
i used to have shorts where my phone goes into lower power mode on its own when it reaches 20% and that it will remind me to unplug once battery status reaches 90%. But now I am not able to do that as the if statement does jot have the conditions that it used to have before. I used the if equal to, if lesser than, if greater than features for these shortcuts of mine. Now all I see are two conditions that basically only checks for value. Which again makes no sense because your battery status will always have a value ranging from 0-100. So how do I solve this I don’t know. The conditons need to come back!
Replies
1
Boosts
1
Views
1.7k
Activity
Apr ’23
Battery health got low fast
So I got my phone like 3 months ago in December 12 from not authorized apple store, we dont have as i think, and it got to 96% on past month and now when I looked it has 90%. I wasnt charging from 0-100, it was 20-90 always, like I didn't treat my old iphone 7 that well and it was absolutely 2 years of heaven. only differences between them are that this one is factory changed iPhone XS and old one was with real iPhone factory made materials and didnt charged anything, SO IS this problem that I have bad battery or the phone is badly factory upgraded. tell me what to do in reply's thanks and have fun.
Replies
0
Boosts
0
Views
905
Activity
Mar ’23
Correct way to read out information about current energy usage battery&charger/adapter
I'm looking for a way to read out the current energy drain of various macOS devices that should be backwards compatible at least to macOS 12. So far I already had a couple of good idea – well initially I thought so – to get that data from ioreg or IOKit, reading out AppleSmartBattery object. I'm trying to write a small program in Rust that collects the energy usage of our companies macOS devices and record this how much happened while in the office and how much on the road. Therefore I need to consider cases where the battery is charging as well as the battery is full and energy is drawn from the power adapter or usb-c connected display directly via PD. So far I was able to read the desired data out via ioreg with plist output and parse the information into a struct. The issue I have testing this out that my 1st approach of going for PowerTelemetryData which would be perfect is only available on macOS 13+ systems. The second approach reading out the subobjects of BatterData and PowerOutDetails seem to only be available on macOS 12 devices now and then. Any suggestions or hints?
Replies
1
Boosts
0
Views
1.3k
Activity
Feb ’23
What does the number key means in log-power-timestamp.session
I get a log-power session from my iPhone analyze, I want to know the power consuming of my app, power_metrics as below: "power_metrics" : { "network_io" : { "cellular" : { "totalUpload" : 4478468, "totalDownload" : 223284091 }, "wifi" : { "totalUpload" : 195605789, "totalDownload" : 1233202961 } }, "display_apl" : { "totalFrameCount" : 209019, "averagePixelLuminance" : 38 }, "app_energy" : { "bg_audio" : { "10" : 563, "6" : 70, "4" : 25, "2" : 26, "7" : 236, "11" : 577 }, "bg" : { "10" : 15501, "6" : 1931, "4" : 689, "2" : 725, "7" : 6504, "11" : 15878 }, "fg" : { "7" : 137056, "3" : 3069, "11" : 334589, "4" : 14555, "1" : 505774, "6" : 40718, "2" : 15294, "10" : 326637 }, "total" : { "7" : 143797, "3" : 3069, "11" : 351045, "4" : 15270, "1" : 505774, "6" : 42720, "2" : 16046, "10" : 342702 } }, "app_time" : { "GPU" : 503, "CPU" : 2479, "bg_unplugged" : { "audio" : 6, "location_audio" : 0, "total" : 171, "location" : 0 }, "fg_total" : 3492, "fg_unplugged" : 3492, "cellular_condition" : { "signalBarUnknown" : 0, "signalBar1" : 91, "signalBar0" : 0, "signalBar4" : 2282, "signalBar3" : 1060, "signalBar2" : 341 }, "bg_total" : { "audio" : 6, "location_audio" : 0, "total" : 171, "location" : 0 } } }, The key 10, 6, 4, 2, 7, 11 means what? "10" : 563, "6" : 70, "4" : 25, "2" : 26, "7" : 236, "11" : 577
Replies
1
Boosts
0
Views
1.8k
Activity
Feb ’23
Improving battery reading when the machine wakes.
I am using the CFProperty "AppleRawCurrentCapacity" value from IOServiceGetMathcingService( kIOMainPortDefault, IOServiceMatching( "AppleSmartBattery" ) ) to obtain the mAh value of the MacBook's battery. Once when the app receives the NSWorkspace notification of display sleep, and once again when receiving the NSWorkspace notification of display wake. I then calculate how much battery was expended during sleep by deducting the pre value from post value. The results can wildly vary, from it using 16 mAh per hour, to gaining 10 mAh an hour (without being plugged in). Sometimes a 10 hour sleep doesn't use any mAh... Which is clearly wrong. When my app detects the key kIOPMPSInvalidWakeSecondsKey is present, I set a timer for that period + 3 seconds and attempt to read the battery values again. Yet the results can still wildly vary. I see on Intel Macs there is a kIOPMPSMaxErrKey (set to 9 on a 2019 16"), however I don't see this on M1, and don't know how it can help, if it does exist. Can anyone give me any pointers as to what I am doing wrong, or in the direction of obtaining reliable mAh values? I like mAh as it's more precise that the standard integer values of 0 - 100, but I don't have to stick with mAh, I'd just don't like reporting that a 16 hour sleep didn't use any battery, when I know it's not true. Thanks
Replies
1
Boosts
0
Views
1.4k
Activity
Jan ’23
iPhone 13 Battery Health
Hi, I’ve had my iPhone 13 for a little more than a year at this point and i checked my battery health to check where it was at. To my surprise, it had dropped 9% to now only be at 91% battery health. After doing research on what might have caused that I noticed a recurring theme about 5g having an effect on my battery health. I just wanted to verify what could be causing the fast deterioration of my battery health and if there’s anything I can do to slow down the loss of the battery.
Replies
1
Boosts
0
Views
974
Activity
Dec ’22
Bartery Health drain
I’ve had my iPhone since July and my battery health has stayed at 99% for a good while now yesterday I checked it was the exact same but today when I checked it went down to 96% we have cold weather here but could it be due to cold weather even though I had my phone in my pocket during the entire time?
Replies
1
Boosts
0
Views
1k
Activity
Nov ’22
Battery performance poor in iPhone 14 pri
I’m not a developer but I really wanted to reach you out to raise a concern. When the launch of iPhone 14 pro happened it was advertised as 30-40% increase in battery performance due to the changes in hardware. Unfortunately the battery is draining 2x as fast as iPhone 13 Pro and iPhone 12 which is incredibly disappointing. Please do not do false marketing on your product if the feature is fully developed. I bought this phone for 1600$ and this is what I get. Please fix this. Battery backup is the most important thing rather than the focused features such as dynamic island and always on Display
Replies
1
Boosts
0
Views
963
Activity
Oct ’22