仪器可以使用命令行中使用? [英] Can Instruments be used using the command line?
问题描述
能仪器被用作替换
的valgrind
如果一个人想检查使用仪器内存泄漏能不能从终端使用吗?
If one wants to check for memory leaks using instruments can it be used from the terminal?
推荐答案
仪器有一个命令行界面:
Instruments has a command line interface:
$ instruments -h
实例:
$ instruments -t mytemplate -a myapp.app
有关泄漏,请尝试 Leaks.tracetemplate
。要查看所有可用的模板,使用 -s
。
For leaks, try the Leaks.tracetemplate
. To see all available templates, use -s
.
还有一个可执行文件,只是叫泄漏
。您可以通过给检查任何正在运行的应用泄漏
其PID:
There is another executable, just called leaks
. You can inspect any running application by giving leaks
its PID:
$ ps aux | grep "[b]ash" | awk '{print $2}'
620
$ leaks 620
leaks Report Version: 2.0
Process: bash [620]
Path: /bin/bash
Load Address: 0x100000000
...
Process 620: 37983 nodes malloced for 1123 KB
Process 620: 0 leaks for 0 total leaked bytes.
了解更多关于泄漏在苹果开发者<一个href=\"http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/ViewingandAnalyzingData/ViewingandAnalyzingData.html%23//apple_ref/doc/uid/TP40004652-CH5-SW22\"相对=nofollow>参考图书馆。
这篇关于仪器可以使用命令行中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!