flutter 安卓打包自定义名字

打包的名字如 app.1.0.1_relase_201283893.apk

实现

配置安卓项目的中的build.gradle (android/app/build.gradle )

新增 android { 内

Dart 复制代码
applicationVariants.all { variant ->
        variant.outputs.all {
            def appName = "拓车服管家" // 文件名
            def version = variant.versionName // 版本号
            def buildType = variant.name // 包类型,debug 还是 release
            def createTime = new Date().format('MMddHHmm') // 打包时间 2021_09_25_16_45_52
            if (buildType == "debug") {
                outputFileName = "${appName}_${version}_${buildType}_${createTime}.apk"
            }
            if (buildType == "release") {
                outputFileName = "${appName}_${version}_${buildType}_${createTime}.apk"
            }
        }
    }
相关推荐
fengci.11 小时前
Microweber CMS 未授权路径穿越漏洞(CVE-2026-65694)
android·开发语言·前端·学习·php
stevenzqzq12 小时前
Android 矢量图(Vector Drawable)核心坐标与尺寸机制技术文档
android
plainGeekDev12 小时前
运行时获取依赖 → 编译时注入
android·java·kotlin
Wiktok12 小时前
Vue3(Vite)打包安卓APP 完整最佳实践
android·vue
略略略咯咯13 小时前
LocalDateTime
android
Co_Hui13 小时前
Android 系统服务的添加
android
蜡台14 小时前
Flutter Container 与装饰完整讲解
android·javascript·flutter·dart
杉氧14 小时前
用 Compose 挑战交互与动效天花板:ComposeCraftLab 开源实验室全解析
android·前端·kotlin
朝与同歌暮同酒15 小时前
冒泡社区《幻想三国》还能玩吗?安卓手机与电脑模拟器试玩记录
android·智能手机·电脑
音视频牛哥16 小时前
从数字孪生到机器人操控:Android Unity3D下RTMP/RTSP多路低延迟播放实践
android·unity·音视频·unity rtsp播放器·unity rtmp播放器·rtsp player·rtmp player