ios – 是否可以在启用断点的情况下使用XCode的仪器?

前端之家收集整理的这篇文章主要介绍了ios – 是否可以在启用断点的情况下使用XCode的仪器?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试优化iOS应用程序的内存使用情况,我想知道应用程序的总内存使用量在代码中的特定点.我以为我应该能够设置断点,使用Activity Monitor配置应用程序,并查看每个断点捕获时的内存使用情况.但是当我运行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/

原文链接:https://www.f2er.com/iOS/334327.html

猜你在找的iOS相关文章