Search code examples
iphoneiosxcodebatterybatterylevel

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 enter image description here then Energy Diagnostics, but I see nothing in energy usage section. enter image description here

How can I enable information in Energy Usage section?


Solution

  • 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

    Now you'll see the energy usage statistics.