android studio 3.0 修改release生成的apk名称
16lz
2022-01-21
apply plugin: 'com.android.application'android { compileSdkVersion 26 defaultConfig { applicationId "com.example.builder.myapplication" minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } //自动生成指定名称的release发布版的 apk文件 android.applicationVariants.all { variant -> def appName if (project.hasProperty("applicationName")) { appName = applicationName } else { appName = parent.name } variant.outputs.all { output -> outputFileName = "Builder_${buildTime()}.apk" } }}def buildTime() { def date = new Date() def formattedDate = date.format('yyyyMMdd') return formattedDate}
更多相关文章
- android 常用的代码
- 使用FragmentTabHost时,tabwidget被frament覆盖。
- Android(安卓)WebView加载本地Html文件
- Android(安卓)Studio批量打包
- android 重命名文件
- Android获取WiFi ip相关信息
- Android拍照、录像、录音代码范例
- 分享几点Android(安卓)开发中的小技巧吧。不知道算不算?
- NPM 和webpack 的基础使用