Today I was trying to add a custom command to a Xamarin.iOS project I have been working on. I wanted to run a script to automate some post build things when doing an Ad-Hoc deployment.

Seemingly easy enough, the first step was to write and test the script. Done. Now to attach it to the custom command during post build. Also easy enough, putting the command in just like it is being called from the terminal. Even checking the "Run on external console" so the script would be visible that it ran. Xamarin references it as "After Execute" but that makes as much sense as "Post Build" Now to test it. Selected Build > Rebuild All. Nothing...



What was I doing wrong? I took to the interwebs, google, Xamarin chat, etc to find a solution. Nothing. Even had a good confirming conversation in xamarin chat that someone else had it work. What could it be? It would work once, but then the very next time, nothing. Then, I pressed the play button. It worked. Wait, hu? Try again, cause it had worked before but not on subsequent tries. It fired again.


Well, dang there it is. If you want the Custom Commands to fire it looks like you gotta press play. Who knew? Maybe I can make it fire up a movie after a successful IPA build to celebrate?