I migrated a project from the previous version of Xcode to Xcode 8. What I want is to use the new visual memory debugger. It's available in new projects, but is entirely missing in my imported one. Why is this?
Inspect the debug memory graph You can generate a memory graph of the objects and allocations in your app by clicking the Debug Memory Graph button in Xcode's debug area at the bottom of the workspace window. The memory graph shows the memory regions your app is using and the size of each region.
Diagnose the Memory LeakChoose “Xcode” in the top left of the screen. Expand “Open Developer Tool,” and select “Instruments” Now choose “Leaks,” and make sure you have chosen your target app and device at the top (“Choose a profiling template for…”):
The Diagnostic Tools window appears automatically unless you have turned it off. To bring up the window again, click Debug > Windows > Show Diagnostic Tools. Choose Memory Usage with the Select Tools setting on the toolbar. Click Debug / Start Debugging (or Start on the toolbar, or F5).
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.
It appears that Swift 3 is required for Visual Memory Debugger to work.
My app migrated to Swift 2.3 did not work, when I tried migrating it to Swift 3.0 it worked instantly.
The runtime sanitization checkbox is not required for visual memory debugger to work, however the reason that it is disabled is the same.
It seems like the project requires Swift 3 to enable Adress & Thread Sanitizer (which is the Memory Debugger).
For me this applies to both iOS & OS X/macOS apps. Both written in Swift 2.2 & converted to 2.3.
Note: I only tested this on OS X El Capitan 10.11.5.
@gabriellanata confirms that it works when the code is converted to Swift 3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With