我已使用 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/