Distribute UWP App to App Center (aka Mobile Center) using VSTS Task

最后都变了- 提交于 2019-12-01 00:48:44

I've worked around this issue for the moment by replacing the built-in task with the App Center CLI and a simple powershell script to archive the same.

param(
    [Parameter(Mandatory=$true)]
    [String]
    $Token,
    # Name of the App, e.g. 'org/app'
    [Parameter(Mandatory=$true)]
    [String]
    $App,
    # Name of the distribution Group, e.g. 'Collaborators'
    [Parameter(Mandatory=$true)]
    [String]
    $Group
)

$binaryFile = (Get-ChildItem MyApp_*_x64.appxbundle -Recurse).FullName
appcenter distribute release -g $Group -f "$binaryFile" -a $App --debug --token $Token

To make this script work, you need the latest version of App Center CLI which can be found here.

On a build agent with NPM package manager present, you can simply run npm install -g appcenter-cli to install the latest version. Afterwards the above script should execute.

I used @SebastianZolg's solution this way:

- task: PowerShell@2
displayName: 'Distribute via AppCenter'
inputs:
    targetType: 'filePath'
    filePath: 'AppCenterDistributeThroughCli.ps1'
    arguments: xxxMyTokenxxxxx MyAppCenterAppSlug "Collaborators"
    workingDirectory: '$(Build.ArtifactStagingDirectory)\AppxPackages'

And AppCenterDistributeThroughCli.ps1 is @SebastianZolg's script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!