I'm working on an app that tracks the users location in background and sends the location to the backend from time to time. I'm interested in monitoring the impact on the battery over a daily use including:
I think Instruments Energy Log and Location Energy Model would be ideal to track the device energy use and I would like to set a wireless tracking session of a few hours. I have setup a Profiling template and it correctly tracks the phone's data when plugged into my Mac, but I can't make it to turn on the wireless profiling mode!
My phone is constantly offline for Wireless Profiling.
Moreover I'm wondering if this the right way to go to keep my app 'under observation' for a few hours and then download the tracing data and analyze it at the end of the session.
iPhone model is a 5s. iOS Version is 10.3.2
Am I doing it right? Am I missing any steps to configure the wireless profiling (I followed the Apple Documentation about wireless profiling)
There is a great option that Apple barely promotes - you can record untethered Energy and Networking data and then import it into Instruments later! On your test device go to the Developer pane in Settings. Logging should be the top option.
Toggle Energy or Network recording and then start recording.
Once you're done testing, stop the recording and connect to your development machine. Make sure to start a new Instruments session with the Energy or Networking template. The option to import from device will be grayed out if you don't have the matching instruments in the session.
You should be able to see variations in the GPS power state. I used this recently to catch a bug where the app was never releasing from high GPS utilization.
iOS 11 & Xcode 9 beta 3 side note: I tested this whole process using the latest betas and of course it crashed Instruments during the import process.
I found a way to fix this issue without rebooting. In terminal, run /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/reenumerate_ios_devices
. It worked instantly for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With