Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mdtool, build android apk on mac

I have a Xamarin project am looking to build a Android apk using mdtool, and the command line. Here is the setup :

I have a mac mini - Xamarin Studio installed on it, I have the solution which build no problem. Now from the command line this is what I an trying to do

#REM Traverse to the folder which holds the .sln file
cd One/Xamarin/Android/OneAndroid 

#REM start the build using mdtool
'/Applications/Xamarin Studio.app/Contents/MacOS/mdtool' -v build OneAndroid.sln

The above completes the build for me , however I do not get an apk file. Could someone share with me which option needs to be added onto mdtool to generate an apk file?

Thanks Rajesh

I understand I maybe missing some parameters for mdtool

like image 959
Raj Avatar asked Jan 24 '14 13:01

Raj


2 Answers

Use XBuild to compile the APK, for example:

xbuild MyXamarinAndroidApplication.csproj /p:Configuration=Release /t:SignAndroidPackage

This will compile the project in release mode and generate a signed and unsigned APK. If you just want an unsigned APK:

xbuild MyXamarinAndroidApplication.csproj /p:Configuration=Release /t:PackageForAndroid

It's worth noting that you have to specify a .csproj, not a .sln. If you give it a solution file, you'll get an error complaining that it can't find the "SignAndroidPackage" target.

like image 106
Tom Opgenorth Avatar answered Oct 12 '22 23:10

Tom Opgenorth


Check out the build process documentation from Xamarin: http://docs.xamarin.com/guides/android/advanced_topics/build_process/offline.pdf

like image 27
Jon Douglas Avatar answered Oct 12 '22 22:10

Jon Douglas