使用 VSTS 任务将 UWP 应用分发到应用中心(又名移动中心) [英] Distribute UWP App to App Center (aka Mobile Center) using VSTS Task

查看:15
本文介绍了使用 VSTS 任务将 UWP 应用分发到应用中心(又名移动中心)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在与 Microsoft 合作解决您的一个 UWP 应用程序在启动后崩溃的情况.在围绕 msbuild 进行了大量调试后,我认识到只有在生成的 appxbundle 文件分布在 Microsoft App Center(又名 Mobile Center)上时才会发生崩溃.这也只有当 appxbundle 上传到 App Center 时,VSTS 内置任务App Center 分发"才会出现这种情况.

I'm currently working together with Microsoft on a case where one of your UWP Apps is crashing after start. After a lot of debugging around msbuild I recognized that the crash only occurs when the resulting appxbundle file is distributed over Microsoft App Center (aka Mobile Center). This is also only the case when the appxbundle is uploaded to App Center with the VSTS built in task "App Center distribute".

当我使用 App Center 门户手动上传 appxbundle 时,它​​一切正常,即使通过 App Center 使用也是如此.

When I upload the appxbundle manually using the App Center Portal it all works fine, even when consumed through App Center.

此外,我注意到构建后 appxbundle 的大小为 18MB,但使用 VSTS 任务上传到 App Center 时只有 14MB 的大小(大小显示在 App Center 门户中).下载后文件未损坏,但似乎缺少捆绑包中的某些文件 - 此任务在做什么?打开和修改 appxbundle?嗯嗯嗯.

Furthermore I noticed that the appxbundle is 18MB in size after build, but is only 14MB in size when uploaded to App Center using the VSTS task (size is shown in App Center Portal). The file is not corrupt after a download but it seems to miss some files in the bundle - what is this task doing? Opening and modifying the appxbundle? uhhhhhh.

有人遇到过类似的问题吗?

Anybody having a similar issue?

推荐答案

我暂时解决了这个问题,将内置任务替换为 App Center CLI 和一个简单的 powershell 脚本来存档相同的任务.

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

要使此脚本工作,您需要最新版本的 App Center CLI,可在 此处找到.

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

在带有 NPM 包管理器的构建代理上,您只需运行 npm install -g appcenter-cli 即可安装最新版本.之后应该执行上面的脚本.

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.

这篇关于使用 VSTS 任务将 UWP 应用分发到应用中心(又名移动中心)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆