Android studio生成APK打包,修改生成APK的路径和名字
16lz
2021-01-23
在app的build.gradle的android添加输出时候的路径和名字
android { compileSdkVersion 26 defaultConfig { applicationId "com.example.test" minSdkVersion 17 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' } } //对生成的apk文件的名字和路径改到其他地方 android.applicationVariants.all { variant -> variant.outputs.all { variant.getPackageApplication().outputDirectory = new File("D:/AndroidStudioProjects/Learning/EasyTest/app/src/main/assets/plugins") outputFileName = "test.jar" } }}
"D:/../app/src/main/assets/plugins"表示编译生成的apk的输出路径
outputFileName = "test.jar" 表示编译生成的apk的文件的名字
当然这样的命名不太规范。但是直观啊哈哈哈 :)
更多相关文章
- Android下载文本文件和mp3文件
- android project 文件夹
- Android 多国语言文件夹
- android shape用法(xml文件)
- android文件关联之mime type
- ubuntu共享文件夹设置
- android文件读取
- 将 android sql文件放生成在sd卡
- Android写本地文件