zoukankan      html  css  js  c++  java
  • Create, Save, and Open Trace Documents

    Create, Save, and Open Trace Documents

    在仪器中,所有的工作都是在跟踪文档中完成的,其中包含一组工具、它们的配置设置和它们收集的数据。一旦您使用跟踪文档来配置应用程序,就可以保存文档以保存收集的跟踪数据,并稍后再打开以便查看和分析。In Instruments, all work is done in a trace document, which contains a set of instruments, their configured settings, and the data they have collected. Once you profile an app with a trace document, you can save the document to preserve the trace data you have gathered and open it again later for viewing and analysis.

    关于仿形模板About Profiling Templates

    当设备启动时,它提供了一个分析模板(见图6-1)。每个模板包含一组工具,这些工具通常用于分析应用程序并收集有用信息,以帮助识别问题或提高应用程序的效率。When Instruments first starts up, it provides a list of profiling templates (see Figure 6-1). Each template contains a collection of instruments that are commonly used together to analyze an app and gather useful information in order to help identify problems or make your app more efficient.

    Figure 6-1The profiling template selection dialogimage: ../Art/instruments_profilingtemplate_dialog_2x.png

    如果需要为特定目的收集数据,您应该计划使用分析模板作为起点。例如,如果要检查内存问题的应用程序,应该选择与内存相关的模板,如分配、泄漏或僵尸。在使用模板创建跟踪文档之后,您可以随时添加或删除单个工具或重新配置工具。You should plan to use a profiling template as a starting point whenever you need to collect data for a particular purpose. For example, if you want to check your app for memory problems, you should choose a memory-related template, such as Allocations, Leaks, or Zombies. After using a template to create a trace document, you can always add or remove individual instruments, or reconfigure instruments, as needed.

    有关可用模板及其所包含的工具的完整列表,请参见分析模板。For a complete list of available templates and the instruments they contain, see Profiling Templates.

    创建跟踪文档Create a Trace Document

    您需要创建跟踪文档以开始使用工具进行分析。You need to create a trace document to begin profiling with Instruments.

    创建跟踪文档To create a trace document
    1. 运载工具。Launch Instruments.

    2. 在出现的分析模板选择对话框中,选择目标设备和进程。In the profiling template selection dialog that appears, select a target device and process.

      image: ../Art/instruments_profiling_dialog_target_2x.png
    3. 选择所需的分析模板。Select the desired profiling template.

      image: ../Art/instruments_profiling_dialog_template_choice_2x.png
    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.

    To save a trace document
    1. Create a trace document. See To create a trace document.

    2. Choose File > Save. Or, choose File > Save As if you want to save a previously saved trace document as a new file.

      image: ../Art/instruments_save_menu_2x.png
    3. Enter a name for the file.

      image: ../Art/instruments_save_dialog_2x.png
    4. Choose a destination for the file.

    5. 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.

    将跟踪文档保存为分析模板To save a trace document as a profiling template
    1. Create or open a trace document. See To create a trace document.

    2. Choose File > Save As Template.

      image: ../Art/instruments_saveastemplate_menu_2x.png
    3. Enter a name for the template.

      image: ../Art/instruments_savetemplate_dialog_2x.png
    4. Choose a destination for the template.

      将您的模板保存在用户/目录/应用程序支持/工具/模板目录中,以便在工具模板窗口的自定义部分中使用它。这是“保存为模板”对话框中的默认目录。Save your template in the /Users/<username>/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.

    5. Select an icon for the template.

    6. Enter a description for the template.

    7. 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.

      image: ../Art/instruments_customprofilingtemplate_2x.png

    Close a Trace Document

    To close an opened trace document
    1. Choose File > Close (or press Command-W).

      image: ../Art/instruments_file_close_menu_2x.png
    2. If your document contains unsaved data, select whether to save the updated document.

      image: ../Art/instruments_close_save_changes_dialog_2x.png

    The document closes.

    Open a Trace Document

    To open a saved trace document

    Do one of the following:

    • Double-click the .trace document file in the Finder.

      image: ../Art/trace_document_2x.png
    • Drag the .trace document file onto the Instruments app icon.

      image: ../Art/instruments_drag_and_open_trace_doc_2x.png
    • Open Instruments and perform the following steps:

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

        image: ../Art/instruments_file_open_menu_2x.png
      2. Locate a saved .trace document file.

        image: ../Art/instruments_open_trace_doc_dialog_2x.png
      3. Click Open.

    The trace document opens in Instruments.

    iOS Android Appcan WeChat
  • 相关阅读:
    [No0000161]IDEA初步接触
    [No0000171]wpf 类层次结构Class Hierarchy
    [No0000160]常用C# 正则表达式大全
    [No000015D]【李笑来 笔记整理】个人商业模式升级
    thinkphp 系统变量
    thinkphp不读取.env文件的键对值
    thinkphp 模板变量输出替换和赋值
    thinkphp 视图view
    thinkphp 响应对象response
    Thinkphp 请求和响应
  • 原文地址:https://www.cnblogs.com/zyingn/p/Create_Save_and_Open_Trace_Documents.html
Copyright © 2011-2022 走看看