Measure Energy Impact XCode Get results

Hi.


I'm doing my bachelor thesis in Computer Science, the subject of my thesis is to compare the battery comsumption in an iPhone using Websockets versus HTTP-Long Polling to communicate with a server. I've read about the different techniques; using external hardware to measure the battery, using XCode Instruments or using the battery indicator on the iPhone. Using external hardware is a big no for me because I don't have the money or time to accuire those tools. The battery-indicator is very unreliable and gives me very mixed results. For example, one time the app I'm testing was just in an idle state, no network activity, and the battery went from 100-95 percent over two hours. Next I tried Websocket for the same time with a 10 second interval for the server to send out messages and the battery only got from 100-98. So that technique is out of the question.


Now I've discovered this XCode Measure Energy Impact, and it seems very good for debugging the application as it runs, but the questions is how I'm going to export these results when the debug session is completed. And yes, I know I can open the log for the network activity and so on in instruments, but what I need is the actual average value for the energy gauge and the average network activity. Maybe this is not possible? I really need an answer and I've been looking all over the internet without finding anything.



Thanks in advance

Accepted Reply

Do you know if Measure Energy Impact with XCode also measures the energy used if Wifi or 4G/3G is used?

As you’re aware, measuring energy use is a super complex topic and, alas, I’m not up to speed on that level of detail of the implementation on the Energy gauge.

We’ve discussed the Energy gauge extensively at WWDC since it was introduced in 2015. You might want to explore the following sessions:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

I don’t think you can export the results from Xcode but you should be able to get the same measurements using Instruments and it does support various flavours of export.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you for your answer. Do you know if Measure Energy Impact with XCode also measures the energy used if Wifi or 4G/3G is used?

Do you know if Measure Energy Impact with XCode also measures the energy used if Wifi or 4G/3G is used?

As you’re aware, measuring energy use is a super complex topic and, alas, I’m not up to speed on that level of detail of the implementation on the Energy gauge.

We’ve discussed the Energy gauge extensively at WWDC since it was introduced in 2015. You might want to explore the following sessions:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"