打包的名字如 app.1.0.1_relase_201283893.apk
实现
配置安卓项目的中的build.gradle (android/app/build.gradle )
新增 android { 内
applicationVariants.all { variant ->variant.outputs.all {def appName = "拓车服管家" // 文件名def version = variant.versionName // 版本号def buildType = variant.name // 包类型,debug 还是 releasedef createTime = new Date().format('MMddHHmm') // 打包时间 2021_09_25_16_45_52if (buildType == "debug") {outputFileName = "${appName}_${version}_${buildType}_${createTime}.apk"}if (buildType == "release") {outputFileName = "${appName}_${version}_${buildType}_${createTime}.apk"}}}
def createTime = new Date().format('MMddHHmm') 这样的打包出来的是时间戳
def createTime = new Date().format('yyyy_MM_dd HH:mm:ss')
app_1.2.3_release_2024_04_10 09:43:08