Xamarin.Android task

Azure Pipelines | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | TFS 2015

Use this task in a build or release pipeline to build an Android app with .


AndroidSDK, MSBuild, Xamarin.Android

YAML snippet

# Xamarin.Android
# Build an Android app with Xamarin
- task: XamarinAndroid@1
    #projectFile: '**/*.csproj' 
    #target: # Optional
    #outputDirectory: # Optional
    #configuration: # Optional
    #createAppPackage: true # Optional
    #clean: false # Optional
    #msbuildLocationOption: 'version' # Optional. Options: version, location
    #msbuildVersionOption: '15.0' # Optional. Options: latest, 15.0, 14.0, 12.0, 4.0
    #msbuildFile: # Required when msbuildLocationOption == Location
    #msbuildArchitectureOption: 'x86' # Optional. Options: x86, x64
    #msbuildArguments: # Optional
    #jdkOption: 'JDKVersion' # Options: jDKVersion, path
    #jdkVersionOption: 'default' # Optional. Options: default, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6
    #jdkDirectory: # Required when jdkOption == Path
    #jdkArchitectureOption: 'x64' # Optional. Options: x86, x64


Argument Description

If you want to build a single Xamarin.Android project, click the ... button and select the project.

If you want to build multiple projects, specify search criteria. You can use a single-folder wildcard () and recursive wildcards (). For example, /.Android.csproj searches for all Android.csproj files in all subdirectories in your repo.

Target (Optional) Specify the project targets you want to build. Use a semicolon to separate multiple targets.
Output Directory Use a variable to specify the folder where you want the output files to go. For example: $(build.binariesdirectory)/$(BuildConfiguration)

Specify the configuration you want to build such as debug or release.

Tip: Declare a build variable such as BuildConfiguration on the Variables tab (selecting Allow at Queue Time) and reference it here as $(BuildConfiguration). This way you can modify the platform when you queue the build and enable building multiple configurations.

MSBuild Options
MSBuild Location (Optional) Path to MSBuild (on Windows) or xbuild (on macOS). Default behavior is to search for the latest version.
Additional Arguments You can pass additional arguments to MSBuild (on Windows) or xbuild (on macOS). For syntax, see MSBuild Command-Line Reference.
JDK Options
Select JDK to use for the build Pick the JDK to be used during the build by selecting a JDK version that will be discovered during builds or by manually entering a JDK path.
  • JDK Version: Select the JDK version you want to use.
  • JDK Path: Specify the path to the JDK you want to use.
JDK Architecture Select x86 or x64.
Control options


Build your Xamarin app

Open source

This task is open source on GitHub. Feedback and contributions are welcome.

Q & A

Do I need an agent?

You need at least one agent to run your build or release. Get an agent for Linux, macOS, or Windows.

I'm having problems. How can I troubleshoot them?

See Troubleshoot Build and Release.

I can't select a default agent pool and I can't queue my build or release. How do I fix this?

See Agent pools.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on Azure Pipelines and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.