美文网首页iOS - 调试
Xcode中的程序调试利器Instruments

Xcode中的程序调试利器Instruments

作者: Liumouren | 来源:发表于2016-05-24 15:28 被阅读247次

作为iOS开发者来讲,当我们的开发完毕或者在开发的过程中需要对APP的整个性能进行检测,如查看有无内存泄漏、内存的分配、CPU使用率、APP的功耗。这些操作是无法在编写程序的时候去完成的。

Apple为我们提供了Instruments去完成这些我们在编程时无法完成的操作,帮助我们提升APP的性能。下面简单介绍一下如何使用Instruments

1.Instruments的启动

xcode_product_profile_menu_2x.png

在Xcode中选择Product>Profile即可进入Instruments功能选择面板如下

instruments_profilingtemplate_dialog_2x.png
  • Filter buttons: 选择Instruments标准库中的功能或者自定义功能或者你最近使用过的功能

  • Template list: 所有的功能列表

  • Template description 对所选择功能的简单描述

  • Open an Existing File 打开之前保存过的检测文件

点击Choose即可进入性能检测界面如下 !

instruments_loadedtrace_file_2x.png

2.检测界面各个模块的功能 !

instruments_trace_document_withdata_2x.png
  • Timeline pane: 相等时间间隔下,检测仪器所取的数据展示区域

  • Detail pane: 相等时间间隔下索取程序执行的操作

相关文章

网友评论

  • 3e44e127e9fe:你好,我问一下 ,为啥我用真机的时候,只能定位到内存地址,用模拟机的时候,就能定位到代码,我想用真机也定位到代码 怎么弄啊,谢谢请指教 :smile:

本文标题: Xcode中的程序调试利器Instruments

本文链接:https://www.haomeiwen.com/subject/xuyzrttx.html