App Center Distribute task

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

Use this task in a build or release pipeline to distribute app builds to testers and users through App Center. For details about using this task, see the App Center documentation topic Deploy Azure DevOps Builds with App Center.

Note

In Microsoft Team Foundation Server (TFS) 2018 and previous versions, run and release pipelines are called definitions, runs are called builds, service connections are called service endpoints, stages are called environments, and jobs are called phases.

YAML snippet

# App Center distribute
# Distribute app builds to testers and users via Visual Studio App Center
- task: AppCenterDistribute@3
  inputs:
    serverEndpoint: 
    appSlug: 
    appFile: 
    #symbolsOption: 'Apple' # Optional. Options: apple, android
    #symbolsPath: # Optional
    #symbolsPdbFiles: '**/*.pdb' # Optional
    #symbolsDsymFiles: # Optional
    #symbolsMappingTxtFile: # Optional
    #symbolsIncludeParentDirectory: # Optional
    #releaseNotesOption: 'input' # Options: input, file
    #releaseNotesInput: # Required when releaseNotesOption == Input
    #releaseNotesFile: # Required when releaseNotesOption == File
    #isMandatory: false # Optional
    #destinationType: 'groups' # Options: groups, store
    #distributionGroupId: # Optional
    #destinationStoreId: # Required when destinationType == Store
    #isSilent: # Optional

Arguments

ArgumentDescription
App Center service connection(Required) Select the service connection for App Center. Create a new App Center service connection in Azure DevOps project settings.
App slug(Required) The app slug is in the format of {username}/{app_identifier}. To locate {username} and {app_identifier} for an app, click on its name from https://appcenter.ms/apps, and the resulting URL is in the format of https://appcenter.ms/users/{username}/apps/{app_identifier}. If you are using orgs, the app slug is of the format {orgname}/{app_identifier}.
Binary file path(Required) Relative path from the repo root to the APK or IPA file you want to publish
Symbols type(Optional) Include symbol files to receive symbolicated stack traces in App Center Diagnostics. Options: Android, Apple.
Symbols path(Optional) Relative path from the repo root to the symbols folder.
Symbols path (*.pdb)(Optional) Relative path from the repo root to PDB symbols files. Path may contain wildcards.
dSYM path(Optional) Relative path from the repo root to dSYM folder. Path may contain wildcards.
Mapping file(Optional) Relative path from the repo root to Android's mapping.txt file.
Include all items in parent folder(Optional) Upload the selected symbols file or folder and all other items inside the same parent folder. This is required for React Native apps.
Create release notes(Required) Release notes will be attached to the release and shown to testers on the installation page. Options: input, file.
Release notes(Required) Release notes for this version.
Release notes file(Required) Select a UTF-8 encoded text file which contains the Release Notes for this version.
Require users to update to this release(Optional) App Center Distribute SDK required to mandate update. Testers will automatically be prompted to update.
Release destination(Required) Each release will be distributed to either groups or a store. Options: groups, store.
Destination IDs(Optional) IDs of the distribution groups to release to. Leave it empty to use the default group and use commas or semicolons to separate multiple IDs.
Destination ID(Required) ID of the distribution store to deploy to.
Do not notify testers. Release will still be available to install.(Optional) Testers will not receive an email for new releases.
Control options

Example

This example pipeline builds an Android app, runs tests, and publishes the app using App Center Distribute.

# Android
# Build your Android project with Gradle.
# Add steps that test, sign, and distribute the APK, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/ecosystems/android

pool:
  vmImage: 'macOS-latest'
steps:

  - script: sudo npm install -g appcenter-cli
  - script: appcenter login --token {YOUR_TOKEN}

  - task: Gradle@2
    inputs:
      workingDirectory: ''
      gradleWrapperFile: 'gradlew'
      gradleOptions: '-Xmx3072m'
      publishJUnitResults: false
      testResultsFiles: '**/TEST-*.xml'
      tasks: build

  - task: CopyFiles@2
    inputs:
      contents: '**/*.apk'
      targetFolder: '$(build.artifactStagingDirectory)'

  - task: PublishBuildArtifacts@1
    inputs:
      pathToPublish: '$(build.artifactStagingDirectory)'
      artifactName: 'outputs'
      artifactType: 'container'

  # Run tests using the App Center CLI
  - script: appcenter test run espresso --app "{APP_CENTER_SLUG}" --devices "{DEVICE}" --app-path {APP_FILE} --test-series "master" --locale "en_US" --build-dir {PAT_ESPRESSO} --debug

  # Distribute the app
  - task: AppCenterDistribute@3
    inputs:
      serverEndpoint: 'AppCenter'
      appSlug: '{APP_CENTER_SLUG}'
      appFile: '{APP_FILE}' # Relative path from the repo root to the APK or IPA file you want to publish
      symbolsOption: 'Android'
      releaseNotesOption: 'input'
      releaseNotesInput: 'Here are the release notes for this version.'
      destinationType: 'groups'

Open source

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