如何在 Azure Devops 发布管道中为已构建的 APK 重新签名/更改包 ID

How to resign/ change bundle id for an already built APK in an Azure Devops release pipeline

我正在与一位客户合作,他希望将其 android 应用程序的多个版本(代表 DEV、TEST、UAT、PROD 等)部署到同一设备。

通常,对于任何应用程序,我更愿意将相同的已编译二进制代码从一种环境提升到另一种环境。例如,如果构建在 TEST 中通过了测试,我想将那个确切的构建(可能具有不同的配置)提升到 UAT。如果客户端测试环境是不同的设备,这是可能的,但考虑到它们具有相同的 android 设备 运行 多个版本的应用程序,我想知道这里是否有任何最佳实践。

客户端正在使用 Azure DevOps。有没有一种简单的方法可以将 APK 作为 Azure 构建管道的一部分构建,然后更改其 Bundle Id,或在发布管道中更改 google-services.json 以指示它是 "Dev"或 "QA" 版本的应用程序?

您可以尝试使用扩展名 'Mobile App Tasks for iOS and Android', this extension includes tasks to change app's version name and code or app's package name at build/release time. If the extension can not satisfy your requirement, you can refer the source code, modify it and create a custom extension. Please see how to create a custom pipleline task.