O'Reilly logo

iOS Programming Cookbook by Hossam Ghareeb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Measuring energy impact

All users suffer from the draining of the life of their mobile phone's battery during usage. What a frustrating moment when you see your phone is about to die and you don't have access to any power supply. Developers, your device, and the operating system are all involved in taking care of the battery life. Any inefficient way of performing a task in the app may cause an impact on the battery life and needs your intervention to do it in a better way. In this recipe, we will see how to measure the app energy usage from Instruments.

How to do it...

  1. Pick any Xcode project you have, and click on Profile.
  2. Choose Energy Log from the following list of instruments:

  3. Choose the device/simulator and the app from the target device and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required