Best way to benchmark iPhone app's battery usage?

Dean picture Dean · Oct 25, 2011 · Viewed 8.2k times · Source

What's the best way to benchmark an iPhone app's battery usage?

I'm working on an iPhone app that uses location services and runs in the background. It seems like the battery drains significantly faster with it running, but when I try to do some structured tests, the results are inconclusive.

The steps I'm taking are:

  1. charge the battery to 100%
  2. remove the SIM (I need it for my other phone)
  3. turn off push for mail/calendar/contacts
  4. reinstall the app
  5. restart the phone
  6. start the app
  7. return to SpringBoard (the app selection screen)

I then wait for about 15 hours and see what the battery is at. The results so far are:

  • App not running - 69% left
  • App running - 65% left
  • App running - 83% left

Answer

Dean picture Dean · Nov 17, 2011

Turns out the answer is to use Apple's Measure Energy Impact in Xcode.

The info it provides really helped track down what was causing our battery draining issue.

In retrospect, I should have said that I was completely new to iOS, and was not a developer (working on the app as QA).