Partager via


Xamarin.Android task

TFS 2017 | TFS 2015

Use this task to build an Android app with Xamarin.

Demands

AndroidSDK, MSBuild, Xamarin.Android

Arguments

Argument Description
project
Project
(Required) Relative path from repo root of Xamarin.Android project(s) to build. Wildcards can be used more information.
For example, **/*.csproj for all csproj files in all subfolders. The project must have a PackageForAndroid target if Create App Package is selected.
Default value: **/*.csproj
Argument aliases: projectFile
target
Target
(Optional) Build these targets in this project. Use a semicolon to separate multiple targets.
outputDir
Output Directory
Optionally provide the output directory for the build.
Example: $(build.binariesDirectory)/bin/Release
Argument aliases: outputDirectory
configuration
Configuration

(Optional) 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.

createAppPackage
Create app package
(Optional) Passes the target (/t:PackageForAndroid) during build to generate an APK.
Default value: true
clean
Clean
(Optional) Passes the clean target (/t:clean) during build
Default value: false

MSBuild options

Argument Description
msbuildLocationMethod
MSBuild
(Optional) Path to MSBuild (on Windows) or xbuild (on macOS). Default behavior is to search for the latest version.
Default value: version
Argument aliases: msbuildLocationOption
msbuildVersion
MSBuild version
(Optional) If the preferred version cannot be found, the latest version found will be used instead. On macOS, xbuild (Mono) or MSBuild (Visual Studio for Mac) will be used.
Default value: 15.0
Argument aliases: msbuildVersionOption
msbuildLocation
MSBuild location
(Required) Optionally supply the path to MSBuild (on Windows) or xbuild (on macOS)
Default value: version
Argument aliases: msbuildFile
msbuildArchitecture
MSBuild architecture
Optionally supply the architecture (x86, x64) of MSBuild to run
Default value: x86
Argument aliases: msbuildArchitectureOption
msbuildArguments
Additional Arguments
(Optional) Additional arguments passed to MSBuild (on Windows) or xbuild (on macOS).

JDK options

Argument Description
jdkSelection
Select JDK to use for the build
(Required) 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.

Default value: JDKVersion
Argument aliases: jdkOption
jdkVersion
JDK version
(Optional) Use the selected JDK version during build.
Default value: default
Argument aliases: jdkVersionOption
jdkUserInputPath
JDK path
(Required) Use the selected JDK version during build.
Default value: default
Argument aliases: jdkDirectory
jdkArchitecture
JDK Architecture
Optionally supply the architecture (x86, x64) of JDK
Default value: x64
Argument aliases: jdkArchitectureOption

Task control options

Example

Build your Xamarin app

Open source

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

FAQ

Do I need an agent?

You need at least one agent to run your build or release.

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.

My NuGet push task is failing with the following error: "Error: unable to get local issuer certificate". How can I fix this?

This can be fixed by adding a trusted root certificate. You can either add the NODE_EXTRA_CA_CERTS=file environment variable to your build agent, or you can add the NODE.EXTRA.CA.CERTS=file task variable in your pipeline. See Node.js documentation for more details about this variable. See Set variables in a pipeline for instructions on setting a variable in your pipeline.

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.