gpt4 book ai didi

ios - 是否可以在启用断点的情况下使用 XCode 的 Instruments?

转载 作者:可可西里 更新时间:2023-11-01 03:08:39 25 4
gpt4 key购买 nike

我正在尝试优化 iOS 应用程序的内存使用情况,我想查看该应用程序在代码中特定点的总内存使用情况。我在想我应该能够设置断点,使用 Activity Monitor 分析应用程序,并只查看每个断点捕获时的内存使用情况。但是当我运行 Instruments 时,似乎断点不再停止执行,因此很难准确知道内存使用量何时发生变化。

是否可以同时使用断点和Instruments?如果没有,是否有一种聪明的方法可以编写一些代码,以便在特定事件发生时将标记插入仪器时间轴?

最佳答案

我今天也遇到了这个问题,经过一番搜索,我找到了这个解决方案。以下文字引自帖子:

Breakpoints Do Not Break. Instruments utilizes debug information from your debug build, however, it does not stop at break points you set. This is because while you are loading your application into Instruments from the menu in XCode, Instruments simply uses the path of the current executable as its start path and loads it externally from XCode. The menu in XCode is really there as a convenience mechanism. This is not a big deal as you can always run again in Debug mode after your instruments session should you want your application to break. It’s just something to make a note of.

NSLog Statements Do Not Show In The Debugger Console. If you want to see your NSLog statements, you will need to load the system Console application (/Applications/Utilities/Console).

引用:http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/

关于ios - 是否可以在启用断点的情况下使用 XCode 的 Instruments?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7932167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com