性能测试工具 搬运工 - iOS Instruments Quick Start

55hhy · 2015年04月13日 · 最后由 陈恒捷 回复于 2015年04月14日 · 1870 次阅读
本帖已被设为精华帖!

原地址:https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/InstrumentsQuickStart/InstrumentsQuickStart.html#//apple_ref/doc/uid/TP40004652-CH19-SW1

@ 群主 我是自己看的,才刚刚开始,很浅显,如果觉得没有意思,我不介意删掉吖

看起来 iOS 的 instruments 很强大很全面的样子,可以在 app 运行时搜集 performance data 或者其他跟踪的数据。同时可以通过组合参数的方式来跟踪数据,例如如果 app 是因为网络链接导致 memory 过高,那就用 Allocations 和 Connections 两个 instrument 组合,来确认导致 memory 过高的某个网络连接。

Instrument 工具用独立的数据搜集模块来搜集一段时间内的数据。每一个 instrument 搜集并显示不同类型的数据,例如 file access,memory use,等等。Instruments 其实就是一系列的标准化的工具,用户也可以用 DTrace 来自定义工具搜集其他类型的数据。

注:iTunes、DVD Player 以及用 QuickTime 的 apps,涉及敏感信息,所以不能通过 DTrace 搜集数据。

Launching Instruments
方法一:从 Xcode 中打开
Xcode -> Developer Tool -> Instruments

方法二:building 时运行 Instruments

  1. 在 Instruments 弹出框中选择一个 Instrument 模版
  2. 运行程序 building,长按 run 按钮选择 profile 之后会弹出 instruments 选择模版开始

方法三:从 Dock 上运行 Instruments
用以上方法之一打开之后,右键 Dock 设置

Gathering Your First Data
每个 Instrument 都是不一样的,但有一个总体流程用于搜集 app 的数据:

  1. 打开 Instruments
  2. 选择目标设备以及 app
  3. 选择跟踪模版
  4. 搜集 app 的信息
  5. 检查搜集的信息
共收到 4 条回复 时间 点赞

很不错的入门介绍。如果能把各个默认模板都有简单介绍就好了。

另外解答一下你的问题:

4.运行程序 building(这个我没有实现,不晓得哪里不对)

原文的意思:如果你想在 build 后在 Instruments 中运行被测应用,请长按 Run 按钮(像播放按钮的那个),然后在出现的菜单里选择 profile,或者直接在 Product 菜单里选择 profile。(实际上就是在 build 后自动打开 instruments 给你)

#2 楼 @chenhengjie123 哦 实现了 谢

#3 楼 @55hhy 麻烦更新一下正文吧。

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册