Log energy usage directly on an iOS device

Log energy data in iOS

  1. Go to Settings > Developer > Logging on your device.

    Note: To see the Developer settings, you must provision the device for development and connect it to your Mac while Xcode or Instruments is running. If your device hasn’t been provisioned yet, see Configuring Your Xcode Project for Distribution and Launching Your App on Devices in App Distribution Guide. Even after the device has been provisioned, the Developer setting disappears when the device is rebooted or powered off. To restore the setting, reconnect the device to Xcode or Instruments.

    Log energy usage directly on an iOS device_第1张图片

    Log energy usage directly on an iOS device_第2张图片

  2. Enable energy logging.

    Log energy usage directly on an iOS device_第3张图片

  3. Tap Start Recording.

    Log energy usage directly on an iOS device_第4张图片

  4. Use your device normally.

  5. When you’re done, return to Settings > Developer > Logging and tap Stop Recording.

    Log energy usage directly on an iOS device_第5张图片

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 Log profiling template.

    Log energy usage directly on an iOS device_第6张图片

  2. Choose File > Import Logged Data from Device.

    Log energy usage directly on an iOS device_第7张图片

    The logged data is imported and displayed in the timeline and detail panes.

    Log energy usage directly on an iOS device_第8张图片

 

https://help.apple.com/instruments/mac/current/#/dev03a7149d

你可能感兴趣的:(性能测试)