Dean
Dean

Reputation: 9128

Best way to benchmark iPhone app's battery usage?

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:

Upvotes: 4

Views: 9049

Answers (2)

Dean
Dean

Reputation: 9128

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).

Upvotes: 9

deanWombourne
deanWombourne

Reputation: 38475

Doesn't that just tell you that there's not a high correlation between battery usage and your app running? It looks like there's something else that's causing battery drain?

(Watch out though, that something else might be the number of gps satellites passing at the time - the faster it gets GPS, the less battery usage your app will consume - you might have to take a look at how much time your app actually spends running vs sleeping for each test)

Upvotes: 1

Related Questions