Jaa


App Center Distribute task

TFS 2017

Use this task to distribute app builds to testers and users through App Center.

Note

In Microsoft Team Foundation Server (TFS) 2018 and previous versions, build 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.

Arguments

Argument Description
serverEndpoint
App Center service connection
(Required) Select the service connection for App Center. Create a new App Center service connection in Azure DevOps project settings.
appSlug
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}.
app
Binary file path
(Required) Relative path from the repo root to the APK or IPA file you want to publish
Argument alias: appFile
buildVersion
Build version
(Optional) The build version of the uploading binary which needs to be specified for .zip and .msi. This value will be ignored unless the platform is WPF or WinForms.
symbolsType
Symbols type
(Optional) Include symbol files to receive symbolicated stack traces in App Center Diagnostics. Options: Android, Apple, UWP.
Argument alias: symbolsOption
symbolsPath
Symbols path
(Optional) Relative path from the repo root to the symbols folder.
appxsymPath
Symbols path (*.appxsym)
(Optional) Relative path from the repo root to PDB symbols files. Path may contain wildcards.
dsymPath
dSYM path
(Optional) Relative path from the repo root to dSYM folder. Path may contain wildcards.
Argument alias: symbolsDsymFiles
mappingTxtPath
Mapping file
(Optional) Relative path from the repo root to Android's mapping.txt file
Argument alias: symbolsMappingTxtFile
nativeLibrariesPath
Native Library File Path
(Optional) Relative path from the repo root to the additional native libraries you want to publish (e.g. .so files)
packParentFolder
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.
Argument alias: symbolsIncludeParentDirectory
releaseNotesSelection
Create release notes
(Required) Release notes will be attached to the release and shown to testers on the installation page. Options: input, file.
Default value: input
Argument alias: releaseNotesOption
releaseNotesInput
Release notes
(Required) Release notes for this version.
releaseNotesFile
Release notes file
(Required) Select a UTF-8 encoded text file which contains the Release Notes for this version.
isMandatory
Require users to update to this release
(Optional) App Center Distribute SDK required to mandate update. Testers will automatically be prompted to update.
Default value: false
destinationType
Release destination
(Required) Each release will be distributed to either groups or a store. Options: groups, store.
destinationGroupIds
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.
Argument alias: distributionGroupId
destinationStoreId
Destination ID
(Required) ID of the distribution store to deploy to.
isSilent
Do not notify testers. Release will still be available to install.
(Optional) Testers will not receive an email for new releases.

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.