Skip to content

Latest commit

 

History

History
293 lines (234 loc) · 10.7 KB

android-build-v1.md

File metadata and controls

293 lines (234 loc) · 10.7 KB
title description ms.date monikerRange
AndroidBuild@1 - Android Build v1 task
AndroidBuild@1 is deprecated. Use Gradle.
05/14/2024
<=azure-pipelines

AndroidBuild@1 - Android Build v1 task

:::moniker range="<=azure-pipelines"

Use this task to build an Android app using Gradle and (optionally) start the emulator for unit tests.

The AndroidBuild@1 task is deprecated. Use the Gradle task instead.

:::moniker-end

Syntax

:::moniker range=">=azure-pipelines-2019"

# Android Build v1
# AndroidBuild@1 is deprecated. Use Gradle.
- task: AndroidBuild@1
  inputs:
    #gradleWrapper: # string. Location of Gradle Wrapper. 
    #gradleProj: # string. Project Directory. 
    #gradleArguments: 'build' # string. Gradle Arguments. Default: build.
  # Android Virtual Device (AVD) Options
    avdName: 'AndroidBuildEmulator' # string. Required. Name. Default: AndroidBuildEmulator.
    #createAvd: AndroidBuildEmulator # boolean. Create AVD. Default: AndroidBuildEmulator.
    #emulatorTarget: 'android-19' # string. Required when createAvd = true. AVD Target SDK. Default: android-19.
    #emulatorDevice: 'Nexus 5' # string. Optional. Use when createAvd = true. AVD Device. Default: Nexus 5.
    #avdAbi: 'default/armeabi-v7a' # string. Required when createAvd = true. AVD ABI. Default: default/armeabi-v7a.
    #avdForce: false # boolean. Optional. Use when createAvd = true. Overwrite Existing AVD. Default: false.
    #avdOptionalArgs: # string. Optional. Use when createAvd = true. Create AVD Optional Arguments. 
  # Emulator Options
    #startEmulator: false # boolean. Start and Stop Android Emulator. Default: false.
    #emulatorTimeout: '300' # string. Required when startEmulator = true. Timeout in Seconds. Default: 300.
    #emulatorHeadless: false # boolean. Optional. Use when startEmulator = true. Headless Display. Default: false.
    #emulatorOptionalArgs: '-no-snapshot-load -no-snapshot-save' # string. Optional. Use when startEmulator = true. Emulator Optional Arguments. Default: -no-snapshot-load -no-snapshot-save.
    #deleteAvd: false # boolean. Optional. Use when startEmulator = true. Delete AVD. Default: false.

:::moniker-end

Inputs

:::moniker range="<=azure-pipelines"

gradleWrapper - Location of Gradle Wrapper
string.

The location of the gradlew wrapper that is used for the build. Agents on Windows (including Microsoft-hosted agents) must use the gradlew.bat wrapper. Agents on Linux or macOS can use the gradlew shell script. Learn more about the Gradle Wrapper.


:::moniker-end

:::moniker range="<=azure-pipelines"

gradleProj - Project Directory
string.

The relative path from the repo root to the root directory of the application. This is most likely to be where the build.gradle file is located.


:::moniker-end

:::moniker range="<=azure-pipelines"

gradleArguments - Gradle Arguments
string. Default value: build.

Provides any options to pass to the Gradle command line. Learn more about the Gradle command line.


:::moniker-end

:::moniker range="<=azure-pipelines"

avdName - Name
string. Required. Default value: AndroidBuildEmulator.

The name of the Android Virtual Device (AVD) to be started or created.

You must deploy your own agent to use this string. You cannot use a Microsoft-hosted pool if you want to create an AVD.


:::moniker-end

:::moniker range="<=azure-pipelines"

createAvd - Create AVD
boolean. Default value: AndroidBuildEmulator.

Creates the named Android Virtual Device (AVD).


:::moniker-end

:::moniker range="<=azure-pipelines"

emulatorTarget - AVD Target SDK
string. Required when createAvd = true. Default value: android-19.

The Android SDK version that the Android Virtual Device (AVD) targets.


:::moniker-end

:::moniker range="<=azure-pipelines"

emulatorDevice - AVD Device
string. Optional. Use when createAvd = true. Default value: Nexus 5.

The device pipeline that may be used. This can be a device index or an Id.


:::moniker-end

:::moniker range="<=azure-pipelines"

avdAbi - AVD ABI
string. Required when createAvd = true. Default value: default/armeabi-v7a.

The Application Binary Interface (ABI) to use for the Android Virtual Device (AVD). Learn more about ABI Management.


:::moniker-end

:::moniker range="<=azure-pipelines"

avdForce - Overwrite Existing AVD
boolean. Optional. Use when createAvd = true. Default value: false.

Overwrites an existing AVD by passing --force to the android create avd command.


:::moniker-end

:::moniker range="<=azure-pipelines"

avdOptionalArgs - Create AVD Optional Arguments
string. Optional. Use when createAvd = true.

Creates additional arguments to pass to android create avd.


:::moniker-end

:::moniker range="<=azure-pipelines"

startEmulator - Start and Stop Android Emulator
boolean. Default value: false.

Starts and stops the Android emulator after the Android Build task finishes.

You must deploy your own agent to use this boolean. You cannot use a Microsoft-hosted pool if you want to use an emulator. Learn more about Azure Pipeline agents.


:::moniker-end

:::moniker range="<=azure-pipelines"

emulatorTimeout - Timeout in Seconds
string. Required when startEmulator = true. Default value: 300.

Defines how long (in seconds) the build will wait for the emulator to start.


:::moniker-end

:::moniker range="<=azure-pipelines"

emulatorHeadless - Headless Display
boolean. Optional. Use when startEmulator = true. Default value: false.

Starts the emulator with no GUI (headless mode) by using the -no-skin -no-audio -no-window value.


:::moniker-end

:::moniker range="<=azure-pipelines"

emulatorOptionalArgs - Emulator Optional Arguments
string. Optional. Use when startEmulator = true. Default value: -no-snapshot-load -no-snapshot-save.

Provides additional arguments to pass to the emulator command.


:::moniker-end

:::moniker range="<=azure-pipelines"

deleteAvd - Delete AVD
boolean. Optional. Use when startEmulator = true. Default value: false.

Deletes the AVD upon task completion.


:::moniker-end

Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

:::moniker range="<=azure-pipelines"

None.

:::moniker-end

Requirements

:::moniker range="<=azure-pipelines"

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: AndroidSDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.83.0 or greater
Task category Build

:::moniker-end