How to enable Visual Memory Debugger in Xcode 8?

2019-04-04 15:53发布

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?

5条回答
迷人小祖宗
2楼-- · 2019-04-04 16:09
Argument '-sanitize=address' is not supported on the Swift 2.3 toolchain. 
You will need to migrate your project to Swift 3 to use this feature.

Xcode 8 GM build error

P.S. Objective-c supported by Visual Memory Debugger

查看更多
一夜七次
3楼-- · 2019-04-04 16:15

If you click on Memory, the source editor pane will change to show some memory information, including why it's disabled. In my case, it was because I had Zombie Objects enabled in the Scheme. (Xcode 8.3.2)

查看更多
forever°为你锁心
4楼-- · 2019-04-04 16:21

It seems like the project requires Swift 3 to enable Adress & Thread Sanitizer (which is the Memory Debugger).

address sanitizer thread sanitizer

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.

查看更多
Lonely孤独者°
5楼-- · 2019-04-04 16:29

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.

查看更多
虎瘦雄心在
6楼-- · 2019-04-04 16:31

I just ran an Objective-C iOS 7 project made with Xcode 7 in Xcode 8 (without migrating) and the Visual Memory Debugger icon appears at the bottom of Xcode in the debugging area next to the Debug View Hierarchy button.

Visual memory Debugger

It's the button with the three circles.

From the other comments, it looks like Swift 3 might be required to use this feature.

查看更多
登录 后发表回答