I've been running into problems with mdtool since I upgraded to the newer Xamarin tools. Here is how I'm using mdtool via the terminal
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool -v build --target:Build --c:"Ad-hoc|iPhone" /path/to/sln
The following is the output of mdtool
ERROR [2013-09-24 16:37:50Z]: ANDROID: Error finding Xamarin.Android SDK
System.ArgumentException: Invalid sdk path
at Xamarin.AndroidTools.MonoDroidSdkBase.Initialize (System.String mfaSdkPath, System.String mfaFrameworkPath) [0x0009d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/md-addins/MonoDevelop.MonoDroid/external/androidtools/Xamarin.AndroidTools/Sdks/MonoDroidSdkBase.cs:70
at Xamarin.AndroidTools.MonoDroidSdk.Refresh (System.String mfaSdkPath, System.String mfaFrameworkPath) [0x00044] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/md-addins/MonoDevelop.MonoDroid/external/androidtools/Xamarin.AndroidTools/MonoDroidSdk.cs:120
Loading solution: /Users/<username>/Projects/p4/perforce/build/main/src/WebMultisim/Source/MyProject.sln
Loading solution: /Users/<username>/Projects/p4/perforce/build/main/src/WebMultisim/Source/MyProject.sln
Loading projects ..
Building Solution: MyProject (Ad-hoc|iPhone)
Building: AnotherTestProject (Debug)
Performing main compilation...
Skipping project since output files are up to date
Build complete -- 0 errors, 0 warnings
Building: MyProject.Core (Debug|iPhoneSimulator)
Performing main compilation...
Skipping project since output files are up to date
Build complete -- 0 errors, 0 warnings
Building: ComponentProject (Debug|iPhoneSimulator)
Performing main compilation...
Skipping project since output files are up to date
Build complete -- 0 errors, 0 warnings
Building: AnotherProject (Debug)
Performing main compilation...
Skipping project since output files are up to date
Build complete -- 0 errors, 0 warnings
Building: MyProjectApp (Debug|iPhoneSimulator)
Performing main compilation...
Notice the configurations. I can't get an Ad-hoc build to start via the command line!
Xamarin Studio has the configurations set up correctly and I can do ad-hoc builds correctly from there.
Any ideas what could be causing this?
Here are all the relevant versions for the tools I'm using.
===============================================
Xamarin Studio Version 4.0.12 (build 3) Installation UUID: 425bb27f-408f-49fa-9b30-7b192d977002 Runtime: Mono 3.2.3 ((no/8d3b4b7) GTK 2.24.20 GTK# (2.12.0.0) Package version: 302030000
Apple Developer Tools Xcode 5.0 (3332.25) Build 5A1413
Xamarin.iOS Version: 7.0.0.11 (Business Edition) Hash: aa35ba3 Branch: Build date: 2013-18-09 16:42:48-0400
Xamarin.Android Not Installed
Xamarin.Mac Xamarin.Mac: Not Installed
Build Information Release ID: 400120003 Git revision: 593d7acb1cb78ceeeb482d5133cf1fe514467e39 Build date: 2013-08-07 20:30:53+0000 Xamarin addins: 25a0858b281923e666b09259ad4746b774e0a873
Operating System Mac OS X 10.8.4 Darwin xxx.xxx.xxx.xxx 12.4.0 Darwin Kernel Version 12.4.0 Wed May 1 17:57:12 PDT 2013 root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
==================================================