build.gradle文件的代码片段:

android {......    //打包后应用名称    applicationVariants.all { variant ->        variant.outputs.each { output ->            def outputFile = output.outputFile            def fileName            if (outputFile != null && outputFile.name.endsWith('.apk')) {                if (variant.buildType.name.equals('release')) {                    fileName = "XXX_v${defaultConfig.versionName}.apk"                } else if (variant.buildType.name.equals('debug')) {                    fileName = "XXX_v${defaultConfig.versionName}_debug.apk"                }                output.outputFile = new File(outputFile.parent, fileName)            }        }    }}

更多相关文章

  1. android 名称
  2. Android Studio修改apk打包生成名称
  3. 安卓页面技巧片段 - 1
  4. android studio3.0build.gradle包含的svn信息apk名称写法等
  5. android 10 高通 图标名称双行显示
  6. android 获取网络类型名称2G 3G 4G wifi
  7. Android开发常用代码片段(二)
  8. Android 界面中隐藏项目名称
  9. Android Bluetooth蓝牙名称修改

随机推荐

  1. android 模拟器获取root权限的方法
  2. 关于Android 中sqlite 报can not open da
  3. android之IntentService类的实现
  4. Android 向菜单按钮说再见
  5. Android Studio 插件的使用
  6. MTP 服务流程
  7. android音频播放简单示例
  8. IndicatorViewPager (笔记)
  9. android中数据存储的contentprovider的使
  10. Android 视频缩略图之MediaMetadataRetri