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:
  1. Choose the device/simulator and the app from the target device and process list.
  2. Click on the Record button at the top-left corner.
  3. Use the app that you want to record normally, and then click on the Stop button.
  4. You should see a detailed analysis of the energy used:
  1. There is another way to log the energy usage while you're away from Instruments.
  2. Go to your iOS device and then go to Settings | Developer | Logging ...

Get iOS Programming Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.