I am currently trying to implement a one-click build solution (without having to start the monodevelop IDE) for my monotouch projects, where i could specify provisioning profiles and code signing certificates. I searched popular build tools like nant, ant and maven, but none seems to support monotouch. Has anyone tried something similar ?
3 Answers
I've gotten it work with Jenkins (aka Hudson).
You basically setup a Jenkins server, and setup your Mac as a "slave" build server. (I used a JNLP slave).
From there you can run any command line you want in the build, so you merely have to run mdtool with some arguments, like so:
/Applications/MonoDevelop.app/Contents/MacOS/mdtool -v build "--configuration:Release|iPhone" "Path/To/YourSolution.sln"
One thing to worry about is that to sign an iOS app, the slave process must run under your user. So you can't really create a Mac daemon for it, you'll have to run the slave process in startup for your user and minimize it, which is kind of annoying.

- 26,115
- 21
- 99
- 182
-
3I was using a similar approach, launching mdtool from xbuild. However, I've recently had problems where it's failing on some ad hoc builds - and occassionally producing a corrupt build. The Mono team tell me there's a problem caused by changes Apple made in the plist format. It's fixed in the GUI, but not in mdtool. They're aware of it, but no ETA for a fix yet. – dommer Apr 12 '11 at 14:35
-
2I just noticed this as well, I haven't started an automated build in a while as my apps haven't needed new changes. Looks like this would need to be fixed before any automated build could be attempted... – jonathanpeppers Apr 12 '11 at 16:25
-
2Looks like this will be fixed in next release. See comment at http://stackoverflow.com/questions/5276187/why-is-mdtool-failing-to-compile-after-i-upgraded-to-latest-version-of-monodevelo/5720918#5720918. – dommer Apr 20 '11 at 08:44
-
The location for this in Xamarin Studio is ```/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool ``` – jpotts18 Jun 13 '13 at 16:38
-
I've read that it's possible to run this thing as daemon, but what you need to do is to setup the keychain to contain all the required certs which is normally handled by XCode automatically. – kubal5003 Jun 10 '15 at 08:22
-
All this stuff works fine now. I just recommend running your build agents under the user account that has all your provisioning profiles setup. We have been using TeamCity for CI for a while now. Might check my blog here about it: http://jonathanpeppers.com/Blog/build-all-the-things!-with-fake – jonathanpeppers Jun 10 '15 at 15:07
You tried teamcity? Might be worth you having a look at this thread Buildserver for MonoTouch upon OS X?
Thx for your answers. However i don't need to use such heavy artillery in this case. Since i'm developping a single and small app, I ended up by creating 3 different Build configurations in my solution, because i found out that it is possible to configure different codesign identities and provisioning profiles for each one (Development, Ad-Hoc, AppleStore), in the monodevelop project options menu.
Then in the AppleStore/Ad-Hoc configuration, i added post build commands, so i could create the .ipa file automatically (basically create a "Payload" folder and copy the .app file into it, and then zip it into a .ipa file, along with the icon and itunesartwork files).
Finally i created a bash script that invokes mdtool with any of the configurations, so i can build and generate .ipa executables by just executing the script.

- 873
- 11
- 25
-
I'm trying to do the same thing you described in this post. Would you mind sharing your bash script and a sample .csproj file with me? – Dave Morris Jun 13 '13 at 20:27
-
Hi, unfortunately, i've lost it. But this was two years ago in the early steps of monotouch. From what i recall the post build commands stopped being necessary, because recent versions of MonoTouch already had such feature built in. You can choose "Build enterprise distribution package" in the project's build settings – madoke Jun 24 '13 at 16:02
-
No problem, I appreciate you looking for it. Our team has something basic going, and hopefully we can post our findings here once we get it all working. Just trying to get TestFlight uploads integrated in now for both iOS and Android. – Dave Morris Jun 25 '13 at 03:19
-
Dave did you ever get something going? Would appreciate any tips/blogposts etc. For eg. what's the command line to upload an IPA to testflight? Did you have that as a separate build step? – Mark Gibaud Jul 04 '14 at 09:19