Search code examples
iosmemoryinstrumentsios-ui-automation

Is there a way to launch automation and allocations tracetemplate using Instruments simultaneously?


I am trying to use Automation instruments together with Allocation instruments to profile the memory usage of our iOS app. The idea is to use Automation to drive the use cases, while the Allocation instruments record some memory data in the background. I am wondering if is it possible to launch automation and allocations tracetemplate using Instruments simultaneously? So that I can check the data recorded by Allocations after the automation is done.

Any pointers would be helpful.


Solution

  • Choose the Automation template. Click the Library button in the toolbar to get a list of available instruments. Find the Allocations instrument in the Library and drag it to the instruments list on the left side of the trace document window. You could also reverse this by choosing the Allocations template and dragging the Automation instrument from the Library.

    After you add the second instrument from the Library, choose File > Save As Template to save your trace as a template. When you profile your app in Instruments, your template will appear in the list of available templates in the User section. Saving as a template keeps you from having to add a second instrument to the trace every time you profile your app.