How can I generate a complete, deployment ready Android APK through MSBuild (or post-build event)?

I want to find a way to build and generate complete deployment ready files both for Android and iOS. iOS is easy, but I can't find any documentation on how to make the android APK without using the Archive tools.

Can someone please tell me how? Thank you in advance.


  • DirkWilhelmDirkWilhelm USMember ✭✭✭✭

    You will need to build your project, sign the apk and then zipalign the apk.

    Try something like this:

    msbuild /p:Configuration=Release /t:PackageForAndroid  your.Project.Droid.csproj
    jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore yourKeyStoreFile -storepass yourKeystorePassword -signedjar yourSigned.apk yourApkFromMsBuild.apk yourKeystoreAlias
    zipalign -f -v 4 yourSigned.apk yourFinaleApk
  • MLyrstadMLyrstad Member ✭✭

    Thank you for your response. I have read it, but I have simply not had time to test it yet. I am sure it will work fine, thank you. I will mark the question as answered once I have verified that it works for me.

Sign In or Register to comment.