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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.