Instrument(二)

create,save,and open tarce documents

创建、保存和打开跟踪文档

Create a trace document

创建跟踪文档
You need to create a trace document to begin profiling with Instruments.
您需要创建一个跟踪文档来开始使用仪器进行分析。
1.Launch Instruments.
发射仪器。
2.In the profiling template selection dialog that appears, select a target device and process.
在出现的分析模板选择对话框中,选择目标设备和进程。
在这里插入图片描述
3.Select the desired profiling template.
在出现的分析模板选择对话框中,选择目标设备和进程。
在这里插入图片描述
4. Click Choose.
单击选择。
A new document is created with the preconfigured instruments from the template you chose.
将使用所选模板中的预配置仪器创建新文档。
Tip: To automatically begin profiling your app immediately after creating the trace document, hold down the Option key in the profiling template selection dialog. When you do this, the Choose button changes to Profile. Click Profile to create the document and initiate profiling right away.
提示:要在创建跟踪文档后立即自动开始评测应用程序,请按住评测模板选择对话框中的选项键。执行此操作时,“选择”按钮将更改为“配置文件”。单击“配置文件”以创建文档并立即启动配置文件。
If you can’t find a template to meet your needs or you just want to create your own from scratch, select the Blank template in the profiling template selection dialog.
如果找不到满足需求的模板,或者只想从头开始创建自己的模板,请在剖析模板选择对话框中选择空白模板。

Save a trace document

保存跟踪文档
Once you’ve created a trace document, you can save it for later reference. Instruments saves trace documents as Instruments trace files with the .trace extension.
创建跟踪文档后,可以将其保存以供以后参考。Instruments将跟踪文档保存为扩展名为.trace的Instruments跟踪文件。

  • Create a trace document. See Create a trace document.
    创建跟踪文档。请参见创建跟踪文档。
  • Choose File > Save. Or, choose File > Save As if you want to save a previously saved trace document as a new file.
    选择文件>保存。或者,如果要将以前保存的跟踪文档另存为新文件,请选择文件>另存为。
    在这里插入图片描述
  • Enter a name for the file.
    输入文件的名称。
    在这里插入图片描述
  • Choose a destination for the file.
    选择文件的目标。
  • Click Save.
    单击保存。

Save a trace document as a profiling template

将跟踪文档另存为分析模板
If you create a trace document you think you might need again for profiling other apps, you can save it as a custom template so you don’t have to recreate it each time you run Instruments.
如果您创建了一个跟踪文档,您认为可能需要再次对其他应用程序进行评测,那么您可以将其保存为自定义模板,这样您就不必在每次运行Instruments时重新创建它。

  • Create or open a trace document. See Create a trace document.
    创建或打开跟踪文档。请参见创建跟踪文档。
  • Choose File > Save As Template.
    选择文件>另存为模板。
    在这里插入图片描述
  • Enter a name for the template.
    输入模板的名称。
    在这里插入图片描述
  • Choose a destination for the template.
    选择模板的目标。
  • Save your template in the /Users//Library/Application Support/Instruments/Templates directory to make it available in the custom section of the Instruments template window. This is the default directory in the Save As Template dialog.
    将模板保存在/Users//Library/Application Support/Instruments/Templates目录中,以使其在Instruments template窗口的custom部分可用。这是“另存为模板”对话框中的默认目录。
  • Select an icon for the template.
    为模板选择一个图标。
  • Enter a description for the template.
    输入模板的说明。
  • Click Save.
    单击保存。
    Once you save a template, it automatically appears in the profiling template selection dialog, grouped with the Custom templates. Next time you create a trace document, you can select it as your starting point.
    保存模板后,它将自动显示在“分析模板选择”对话框中,并与自定义模板分组。下次创建跟踪文档时,可以选择它作为起点。
    在这里插入图片描述

Open a trace document

打开跟踪文档
Open saved trace documents to view results from previous runs or to perform additional profiling.
打开保存的跟踪文档以查看以前运行的结果或执行其他分析。
Do one of the following to open a trace document:

执行以下操作之一以打开跟踪文档:

  • Double-click the .trace document file in the Finder.
    双击Finder中的.trace文档文件。
    在这里插入图片描述

  • Drag the .trace document file onto the Instruments app icon.

将.trace文档文件拖到Instruments应用程序图标上。
在这里插入图片描述

  • Open Instruments and perform the following steps:

打开仪器并执行以下步骤:

  1. Choose File > Open (or press Command-O).

选择文件>打开(或按Command-O)。
在这里插入图片描述

  1. Locate a saved .trace document file.

找到保存的.trace文档文件。
在这里插入图片描述

  1. Click Open.
    单击“打开”。

The trace document opens in Instruments.
跟踪文档将在Instruments中打开。

Close a trace document

关闭跟踪文档
Close a trace document when you’re done working with it.
处理完跟踪文档后,请将其关闭。


Choose File > Close (or press Command-W).
选择文件>关闭(或按Command-W)。
在这里插入图片描述

If your document contains unsaved data, select whether to save the updated document.
如果文档包含未保存的数据,请选择是否保存更新的文档。
在这里插入图片描述


The document closes.
文件关闭。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值