通过Azure android签名构建管道签名后的.apk文件输出在哪里?[英] Where is the .apk file output after signing it via Azure android signing build pipeline?

本文是小编为大家收集整理的关于通过Azure android签名构建管道签名后的.apk文件输出在哪里?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在使用Azure'Android签名'任务在构建管道中签署APK文件,但我无法看到输出签名APK的路径.我已将构建管道的整个根作为.zip文件导出为.zip文件,但签名的.apk文件不存在.更令人困惑的是,Android签名任务是传递,所以签名的.apk必须是对的?问题是哪里!

感谢

推荐答案

android签名'任务没有创建一个新的apk.签名的APK仍处于Android构建任务的输出文件夹中. 如果使用Xamarinandroid任务来构建APK. .apk将输出到以下示例:检查这里所有预定义的变量

- task: XamarinAndroid@1
  inputs:
    projectFile: '**/*droid*.csproj'
    outputDirectory: '$(Build.ArtifactStagingDirectory)'
    configuration: '$(buildConfiguration)'

然后,您可以在下面的示例中添加Android Sign Task和Point APKFiles到$(Build.ArtifactStagingDirectory)/*.apk:

- task: AndroidSigning@3
  inputs:
    apksign: true
    zipalign: false
    apksignerKeystoreFile: levi.keystore
    apkFiles: '$(Build.ArtifactStagingDirectory)/*.apk'
    keystoreAlias: levi
    apksignerKeyPassword: '**'
    apksignerKeystorePassword: '**'
然后,您可以添加发布工件任务以将APK发布到Azure Server,在那里您可以从Azure Devops构建摘要UI完成时,您可以在构建完成时.

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'.

然后您可以从"构建摘要"页面下载APK. 输入图像描述

您可以在从Azure Server下载之后签署以下命令以检查APK是否签名.

$ jarsigner -verify -verbose -certs my_application.apk

本文地址:https://www.itbaoku.cn/post/1937987.html

问题描述

I'm signing an apk file in a build pipeline using the Azure 'Android Signing' task but I cannot see the path in which the signed apk is output to. I've exported the entire root of the build pipeline as .zip file, but a signed .apk file does not exist. What's even more confusing is that the Android Signing task is passing, so the signed .apk must be somewhere right? The question is where!

Thanks

推荐答案

Android Signing' task did not create a new apk. The signed apk is still in the output folder of android build task. If you use XamarinAndroid task to build your apk. The .apk will be output to $(Build.ArtifactStagingDirectory) for below example: Check here for all predefined variables

- task: XamarinAndroid@1
  inputs:
    projectFile: '**/*droid*.csproj'
    outputDirectory: '$(Build.ArtifactStagingDirectory)'
    configuration: '$(buildConfiguration)'

Then you can add the android sign task and point apkFiles to $(Build.ArtifactStagingDirectory)/*.apk for below example:

- task: AndroidSigning@3
  inputs:
    apksign: true
    zipalign: false
    apksignerKeystoreFile: levi.keystore
    apkFiles: '$(Build.ArtifactStagingDirectory)/*.apk'
    keystoreAlias: levi
    apksignerKeyPassword: '**'
    apksignerKeystorePassword: '**'

You can then add a publish artifacts task to publish your apk to azure server,where you can download from azure devops build summary UI when your build is complete.

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'.

Then you can download the apk from your build summary page. enter image description here

You can run below command to check if the apk is signed or not after you downloaded it from azure server.

$ jarsigner -verify -verbose -certs my_application.apk