【问题标题】:Automate profiling for iOS using Xcode 12 xctrace command line tools使用 Xcode 12 xctrace 命令行工具自动分析 iOS
【发布时间】:2021-03-13 12:04:36
【问题描述】:

我正在尝试使用 Xcode 12 Instruments 开发工具自动化性能测试,需要一些帮助。

我想将 .trace 文件解析为可读格式,并想在控制台上打印泄漏/CPU 使用情况。我正在使用下面的 xctrace 命令行来使用 Xcode 12 Instruments 工具自动进行泄漏/时间分析:

xcrun xctrace record --device "udid" --template "Leaks" --time-limit 10m --attach "PID" --output "xyz.trace"

xcrun xctrace export --input "xyz.trace" toc --output "xyz.xml"

如果有人可以提供帮助,那就太好了。

供参考的跟踪文件:https://gofile.io/d/EpvOXa

【问题讨论】:

    标签: ios swift xcode memory-leaks instruments


    【解决方案1】:

    我不确定我是否正确理解了您的问题,但是如果我运行您的命令,我会收到一条错误消息。 CLI 工具给了我以下说明:

    usage: xctrace export [<options>] [--toc | --xpath expression]
    
    description:
        Export given .trace using supplied query to the XML file format that can be later read and post-processed
    
    options:
        --input <file>              Export data from the given .trace file
        --output <path>             Command output is written to the given path, if specified
        --toc                       Present entities to export in the table of contents form
        --xpath <expression>        Choose elements to export using specified XPath expression
    
    notes:
        If output path is not specified, the export operation output will be written to the standard output.
        Table of Contents and XPath query are two separate modes and they cannot be specified together.
    
    examples:
        xctrace export --input input.trace --toc
        xctrace export --input input.trace --toc --output table_of_contents.xml
        xctrace export --input input.trace --xpath '/trace-toc/run[@number="1"]/data/table[@schema="my-table-schema"]'
    

    据此,参数 toc 缺少两个破折号。我希望这将为您解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-04
      • 1970-01-01
      • 1970-01-01
      • 2019-03-02
      • 2013-09-27
      • 1970-01-01
      相关资源
      最近更新 更多