android - 按 ABI 分割时的后缀/前缀/之间的 .APK 名称

标签 android gradle apk android-install-apk

我已使用 this 将我的 .APK 文件拆分为多个较小尺寸的 .APK

据我的理解。 Gradle 系统为我支持的不同 ABI 生成多个 .APK 文件。每个 .APK 均遵循上述命名约定 here

有什么方法可以修改生成的.APK 文件的名称吗?我想在某些字符串值之间添加后缀/前缀/,这将帮助我识别正在生成的 .APK。特别是 gitSha。

最佳答案

是的,在 build.gradle 中使用 outputFileName

这是一个例子:

android.applicationVariants.all { variant ->
    variant.outputs.all { output ->
        outputFileName = applicationName + "-" + output.getFilter(com.android.build.OutputFile.ABI) + "-" + variant.name + ".apk"
    }
}

假设应用程序名称为“MyApp”,对于 x86 ABI 的调试版本,APK 名称将为 MyApp-x86-debug

关于android - 按 ABI 分割时的后缀/前缀/之间的 .APK 名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56647083/

相关文章:

android - 如何使管道符号或 Grep 在 Android 进程运行时命令中工作?

java - Eclipse构建技术

unit-testing - Kotest 打破 gradle 的 :test task with java. lang.IllegalArgumentException: Received a failure event for test with unknown id

android - Amazon Kindle Fire 和 .apk 文件

php - 将 android AsyncHttpClient 中的数组 POST 到 php

android - 为什么当可穿戴设备处于环境模式时不调用 onSensorChange

spring-boot - 无法解析插件工件 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.6.RELEASE'

android - 用于替换调试版本的签名应用程序

android - 不同类型的APK

java - 在回调管理器上获取空指针异常