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

StackOverflow https://stackoverflow.com/questions/20154531

Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

@Assassin, I also have to do this for test automation and I ended up writing an AppleScript to export from the command line, as it looks like Apple doesn't provide any other way to do this. My bash script to do this part looks like this:

open file.trace
sleep 10
osascript InstrumentsExport.scpt

And then I have some fancy awk commands to parse the resulting CSV file. My AppleScript to export to CSV looks like this:

tell application "/Applications/Xcode.app/Contents/Applications/Instruments.app"
    activate
end tell
delay 3
tell application "System Events" to tell process "Instruments"
    set frontmost to true
    tell menu bar item "Instrument" of menu bar 1
        click
        click menu item "Export Track for 'Activity Monitor'..." of menu 1
    end tell
    delay 3
    keystroke return
end tell

For the "Export Track for" text, you'll need to rename that to whatever it's called in your Instruments GUI, complete with "..." at the end.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top