问题描述
默认情况下,IDE可以使apk像app-debug.apk
或app-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.apk
或app-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 Exampleapp 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文件的特定名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!