Search code examples
c++objective-cxcodememory-managementinstruments

XCode 7.2 unable to view memory profiling info / Device is offline in instruments


I'm running an iOS demo using an Objective C++ library (some .mm files) and would like to profile the app's memory usage with Instruments. However, I see that the debug tab does not show any memory information.

enter image description here

enter image description here

Attempting to profile the app in instruments shows my device, but it is grayed out and says it's offline

enter image description here

How can I fix my XCode to allow for memory debugging/profiling of that project? Does it have something to do with using an Objective C++ libraries?


Solution

  • You can check whether your project's Zombie Objects are enabled.

    Open:

    Product -> Scheme -> Edit scheme -> run-Diagnostics -> Enable Zombie Objects

    If open please close then run.

    This is the screenshot Picture

    EDIT: The issue is twofold, the "unable to profile on device is an iOS 9.x.x bug, here's a support thread: https://forums.developer.apple.com/thread/16242 . Here are the steps one of the posters suggested:

    • Power down the device completely.
    • Unplug the device from your Mac.
    • Close Xcode and Instruments.
    • Restart the device & plug it back in once it has restarted.
    • Re-launch Xcode.
    • Here, my device was disabled and Xcode indicated that the device was not available for use.
    • Clean, Build, Profile (Command-I).
    • When Instruments is launched the device was enabled.
    • Upon selecting it, a message was displayed with the title "Enable this device for development?" and message "This will open Xcode and enable this device for development."
    • Click "Open Xcode".
    • Here I did not notice anything being displayed - no additional messages indicating anything had been done or that the device was or was not available for development.
    • Opening the Devices window, the device appeared to be available. Here I was able to select the device in Instruments and profile it. I was also again able to delete installed apps from the Devices window.