I'm trying to reduce my application's battery usage. I'd like to use Xcode tools or instruments to measure before and after to verify I've made an improvement.
I'm having trouble measuring the basics. I want to verify that I am only measuring location on the screen that needs it. The trouble is instrumentation thinks I'm always using the device's GPS/location.
When I use instruments to monitor the process, it shows gps as always on:
So does xcode's energy monitor:
I'm measuring on a real device, and I have tried:
- Never tracking in my code (comment out
locationManager.startUpdatingLocation()
) - Shut down other background apps that might be using location "while using"
- Denied permission for all apps that want location "Always"
- Disabled frameworks I depend on (Hockey, Mixpanel) that might be using location
Still the instrumentation shows constant location usage.
The only 2 things that cause the GPS to show it's been turned off are:
- Disabling all location services for the phone
- Swiping up from the bottom of the phone to show the settings screen for toggling bluetooth, wifi, and airplane mode. (I don't have to do anything, just show the screen)
The first section is starting without location services on for the phone at all, and the second green section is swiping up to show the settings panel:
Any idea what might be going on?
Xcode/Instruments 7.3