我正在尝试使用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
发布于 2021-05-15 03:03:08
我不确定我是否正确理解了您的问题,但如果我运行您的命令,我会收到一条错误消息。CLI-tool给了我以下说明:
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缺少两个破折号。我希望这能帮你解决这个问题。
https://stackoverflow.com/questions/65092680
复制相似问题