Monday, February 11, 2013

List all available instruments templates

Using Apple's instruments on the command line to inspect an iOS application on the device, usually involves a specific template to capture data from the application running on the device.

For my current project I usually used the Automation.tracetemplate to launch my iOS app. But after I've upgraded Xcode from 4.3 to 4.5, the filesystem location of the instruments templates have been slightly changed. The framework that I wrote for the performance tracking system failed in finding the template. I started to investigate a better solution to be able to deal with different Xcode versions that could be found on the dev machines.

For that reason I created a little helper class to identify the version of Xcode to locate the correct path of the Automation.tracetemplate. That works pretty fine, but I don't know if this will work for future Xcode versions too. This solution required xcodebuild -version to determine the Xcode version and xcode-select -print-path to determine the location of the Xcode folder. I needed this information to assemble the path to the templates.
There must be a better, shorter way of getting this information.

A better solution

Running instruments on the command line produces a rather concise than helpful overview of the available options. I couldn't find any manpage for instruments on my machine. Rather by accident than intentional, I came across the instruments manpage on Apple's Developer Connection website.

The manpage contained far more information about the available options including some description for the unknowing user. I discovered the option -s that produces a list of all available instrument templates.  Even if the manpage was targeting the Xcode tools 3.2.5 version (I couldn't find a more recent version), the option is still recognized by the latest instruments (as time of writing I used Xcode 4.6).

Running instruments -s and parsing the output will give me path to the Automation.template. without any guessing or probing. I hope this option will remain available in instruments in future versions.

Tuesday, January 29, 2013

Das tote Pferd

Es gibt diese Weißheit der Dakota Indianer: „Wenn Du entdeckst, dass Du ein totes Pferd reitest, steig ab!”

Und heute ist es wieder passiert. Ich hab die Zeichen wieder nicht gesehen. Vielleicht waren dort auch keine, aber das Pferd auf dem ich geritten bin ist definitv tot. Leider bin ich nicht aus freien Stücken abgestiegen, sondern abgestiegen worden.
Mit anderen Worten: mein Arbeitgeber hat heute mal wieder eine neue strategische Ausrichtung bekannt gegeben und leider war mein Team, und damit eine Menge anderer Kollegen, nicht mehr direkt Teil dieser neuen Strategie. Zum Glück wurde aber keiner meiner Kollegen entlassen. Das hat die Firma aus den vergangenen Umstrukturierungen gelernt. Erst fire, dann hire ist teuer.

Hab ich noch einen Job? Ja, hab ich. Also kein Grund zum meckern. Was für ein Job? Keine Ahnung.

Warum rege ich mich darüber auf? Du bist in den USA. Da ist das doch gang und gebe. Ja, das ist zwar richtig und es verwundert mich auch nicht wirklich. Es ist nur die Häufigkeit der Veränderungen in den letzten 2 Jahren gewesen. Und jedes mal das ungute Gefühl, dass ich irgendwann durch die Mühlen falle und keinen Job mehr habe, wir das Land verlassen müssen, weil das Visum an meinen Arbeitgeber gebunden ist.
Naja, jetzt heisst es erstmal abwarten und sehen was das kommt. Jeder Neuanfang ist auch eine Chance etwas Neues zu lernen.
Also, es ist mal wieder Zeit etwas Neues zu lernen.

Monday, December 24, 2012