18

iOS7 has a preference under " Preferences | Developer | Instruments / Logging | Untethered Recording" to record the energy and network usage data.

How do I extract this from the device to view in Xcode or Instruments?

Luke
  • 2,562
  • 1
  • 18
  • 35

2 Answers2

40

This basically records the same data that would get recorded if you were running the Energy Diagnostics or Network instruments while the device is plugged in, except it'll keep logging in the background all the time without the need for a tethered Instruments session.

You'll need to be running the version of Instruments provided in Xcode 5 (or newer) for this to work. Make sure you have you device plugged in before starting Instruments.

First step is to create a new Trace Document using the corresponding Instrument Template in Instruments' New screen:

Instruments New Screen

Now, in the File menu, a new option Import Logged Data from Device should be available, if you have your device plugged in.

Import Logged Data from Device

You should now see the results from your last run. You don't have to stop logging on your device to access this option, it'll just give you the data between when you started recording to when you pressed the import button.

aethe
  • 909
  • 1
  • 8
  • 12
  • 1
    Do you know if there is a way to filter logged data to a specific process? – Pascal Bourque Jan 15 '14 at 19:41
  • 1
    I am trying to do this, but the "Import Logged Data from Device" is greyed out. Any ideas on why? The device has the proper profiles. – Cesar Maiorino Mar 12 '14 at 14:46
  • I am testing this using Instruments 7.3.1 (7D1014) and an iPhone 5S (iOS 9.3.5) and it is not working... :-( Could someone try this and tell me if it is a problem with my setup or with the software ? Thanks ! – nverinaud Sep 09 '16 at 09:48
2

This Apple page explains the whole process: Energy Efficiency Guide for iOS Apps

To import logged energy data from an iOS device

  1. Launch Instruments and create a new trace document that targets your device and app with the Energy Diagnostics profiling template. Choose Instruments template
  2. Choose File > Import Logged Data from Device.

Import Logged Data from Device

inigo333
  • 3,088
  • 1
  • 36
  • 41
  • is it possible to import multiple runs from one device or do I need to stop and plug it in and import after each run? – Saik Caskey May 08 '19 at 16:31