building android apk with msbuild

rajindersingh's Avatar

rajindersingh

16 Aug, 2015 07:40 PM

I am trying to build a xamarin android client and upload it to hockey app.
My solution has 4 project and one of them is the android client project.

To create APK file I need to build the android project and package it for android

msbuild.exe "MyProject.csproj" /p:Configuration=Release /t:PackageForAndroid

I was building the entire solution using the default msbuild that is provided by appveyor.
Should I be just build the client project using the command above or should I still build the solution?

How I do pass /t:PackageForAndroid option to msbuild?

I wasn't sure how I to add this to environment variable and have it pick up this option during the build process?
I tried using custom script and I lost my before and after build scripts I had previously defined.
I guess it is time for me to switch to using yml file instead of using UI.

In the custom build script can I specify before and after build scripts along with the actual msbuild command.
It will be great to get an example custom msbuild script that has before, and after along with msbuild to build a project

Thanks

  1. Support Staff 1 Posted by Feodor Fitsner on 16 Aug, 2015 11:12 PM

    Feodor Fitsner's Avatar

    I would switch to your own custom commands completely, so on build settings you would have "Script" enabled with two msbuild commands - one is for entire solution and the second one for packaging APK.

    You can restore commands by looking into logs of previous builds.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:59 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac