Android Studio编译输出apk文件修改文件名
2016-04-12 11:14
489 查看
apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.1" defaultConfig { applicationId "com.andriod.demo" minSdkVersion 15 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { //这里修改apk文件名 //def fileName = "demo_${variant.productFlavors[0].name}-${defaultConfig.versionCode}-${defaultConfig.versionName}-${releaseTime() }.apk" def fileName = "apk名称.apk" output.outputFile = new File(outputFile.parent, fileName) } } } sourceSets { main { jniLibs.srcDirs = ['libs'] } } }
相关文章推荐
- android大文件上传断点续传
- Android编程实现可滑动的开关效果(附demo源码下载)
- Android:pt 、sp、dp之间的换算
- android(NDK+JNI)---Android使用JNI实现Java与C之间传递数据
- Android Service 使用总结
- Android中Context详解 ---- 你所不知道的Context
- Android控件GridView之仿支付宝钱包首页带有分割线的GridView九宫格的完美实现
- android开发 greendao学习及使用笔记
- Android上传文件至服务器
- Android中Bitmap,byte[],Drawable相互转化
- android 下载安装并打开apk
- 2016年 代做安卓毕业设计 Android毕业设计
- 【Android】软件界面全屏显示
- Android最佳性能实践(四)——布局优化技巧
- Android 蒙层效果的实现
- android 给图片加水印
- android 6.0 棉花糖 运行时权限
- 将Eclipse代码导入到AndroidStudio的两种方式
- 【Android】控件引用图片
- Android最佳性能实践(三)——高性能编码优化