Can Instruments be used using the command line?

旧街凉风 提交于 2019-11-30 20:30:48
miku

Instruments has a command line interface:

$ instruments -h

Example usage:

$ instruments -t mytemplate -a myapp.app

For leaks, try the Leaks.tracetemplate. To see all available templates, use -s.

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.

Read more about leaks in the Apple developer reference library.

For Xcode 9, if you want to profile a iOS app, an example command like this:

instruments -t Zombies -w 'iPhone SE (11.0.1) [XXX] (Simulator)' MyApp.app

instruments command ref:

https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html#//apple_ref/doc/uid/TP40004652-CH12-SW3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!