Android 如何修改APK的默认名称
作者:lqh 时间:2021-08-12 18:56:42
Android 如何修改APK的默认名称
用Android Studio 打包App时生成的名称默认是 app-release.apk(已签名) 或 app-debug.apk(测试版)。
要想打包时修改默认名称,可以打开在build.gradle(module:app)文件,在android{}中添加如下代码:
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名
def fileName = outputFile.name.replace("app", "你想要的名字")
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
写完直接点击工具栏Build中的 BuildApk 或是使用签名打包即可。
效果图如下:
其实,还可以是这样:右键—>重命名 。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
标签:Android,APK名称
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Android中使用Service实现后台发送邮件功能实例
2022-01-26 16:56:05
java按钮控件数组实现计算器界面示例分享
2021-09-12 22:37:59
Android StickListView实现悬停效果
2022-06-06 15:54:35
![](https://img.aspxhome.com/file/2023/0/123260_0s.gif)
C#实现跨线程操作控件方法
2023-06-30 13:47:39
C++中静态成员函数与静态成员变量(static )
2021-11-08 07:31:38
SpringBoot常用数据库开发技术汇总介绍
2023-11-11 09:39:22
Android 虚拟按键适配动态调整布局的方法
2022-03-03 07:20:24
![](https://img.aspxhome.com/file/2023/5/90135_0s.jpg)
java中javamail发送带附件的邮件实现方法
2023-12-06 02:46:30
Android中通知Notification使用实例(振动、灯光、声音)
2021-09-28 20:00:01
![](https://img.aspxhome.com/file/2023/3/109183_0s.jpg)
C#实现启动项管理的示例代码
2022-07-30 09:09:04
![](https://img.aspxhome.com/file/2023/2/87052_0s.png)
Java parseInt解释加方法示例
2021-09-17 15:13:55
Java实现雪花算法的原理和实战教程
2021-11-20 18:20:41
![](https://img.aspxhome.com/file/2023/6/94346_0s.png)
浅析Java中JSONObject和JSONArray使用
2022-06-05 14:58:30
MyEclipse去除网上复制下来的代码带有的行号(正则去除行号)
2023-09-15 21:59:23
![](https://img.aspxhome.com/file/2023/5/63045_0s.jpg)
什么是递归?用Java写一个简单的递归程序
2022-02-11 19:39:45
![](https://img.aspxhome.com/file/2023/2/60772_0s.jpg)
完美解决idea没有tomcat server选项的问题
2022-02-12 04:20:54
![](https://img.aspxhome.com/file/2023/3/113213_0s.jpg)
Android编程之手机壁纸WallPaper设置方法示例
2023-09-27 20:51:10
Unity UGUI实现简单拖拽图片功能
2022-11-26 19:55:03
![](https://img.aspxhome.com/file/2023/9/77289_0s.jpg)
基于request获取访问者真实IP代码示例
2023-02-15 02:45:13
C#泛型语法详解
2023-01-28 18:20:12
![](https://img.aspxhome.com/file/2023/5/96355_0s.png)