Android:如何在Android Studio中更改生成的APK文件的特定名称? [英] Android: How to change specific name of the generated apk file in Android Studio?

查看:497
本文介绍了Android:如何在Android Studio中更改生成的APK文件的特定名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,IDE可以使apk像app-debug.apkapp-release.apk文件一样,但是我需要生成该应用程序的 Apk 的特定名称.

By default IDE genarate a apk like app-debug.apk or app-release.apk file but I need to generate specific name of the Apk of the App.

例如: 我的应用程序名称为 iPlanter ,因此我需要分别生成 iPlanter-debug.apk iPlanter-release.apk 而不是app-debug.apkapp-release.apk.

For Example: My application name is iPlanter so i need to generate iPlanter-debug.apk or iPlanter-release.apk instead of app-debug.apk or app-release.apk respectively.

谢谢

推荐答案

步骤1: 转到主项目 root ,在 app 下,右键单击 app 并将应用重构为特定名称(示例iPlanter ),然后按确定

Step 1: Go to root of the main project, under app , right click on app and refactor the app into specific name (example iPlanter) and press ok

第2步: 转到项目设置文件,该文件为 setting.gradle文件

Step 2: Go to Project Setting file which is setting.gradle file

setting.gradle文件包含

include ':app'

现在需要用特定名称替换应用程序.

Now need to replace app by specific name.

例如 在 include':app'中将应用替换为iPlanter 看起来像下面

For Example app replace by iPlanter in include ':app' it looks like below

include ':iPlanter'

然后同步项目,然后运行您的应用程序. 最后,App生成一个 iPlanter-debug.apk iPlanter-release.apk 文件之类的apk.

then Sync project, after that run your application. Finally, App generate an apk like iPlanter-debug.apk or iPlanter-release.apk file.

这篇关于Android:如何在Android Studio中更改生成的APK文件的特定名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆