【问题标题】:How to rename android-debug.apk如何重命名 android-debug.apk
【发布时间】:2015-08-24 08:34:41
【问题描述】:

我正在使用 Cordova (5.1.1) 和 ionic 框架来创建我的 android。但是,当我尝试构建 apk 时,为什么文件名总是“android-debug.apk”?有什么办法改名吗?

  1. cordova 创建 hello com.example.hello HelloWorld
  2. cd 你好
  3. cordova 平台添加 android
  4. cordova build android

在hello\config.xml中,name标签已经定义为HelloWorld:

请帮忙。

【问题讨论】:

  • 构建它的想法是什么?
  • 我只使用 cordova CLI 构建

标签: android cordova config


【解决方案1】:

是的,您可以更改 apk 的名称试试这个

buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig getSigningConfig()
        applicationVariants.all { variant ->
            variant.outputs.each { output ->
                output.outputFile = new File(output.outputFile.parent,
                    output.outputFile.name.replace("-debug", "-" + whatever name you want
                )
            }
        }
    }
}

在此之后还要同步和清理项目。

编辑

将此写入 build.gradle 文件中。

【讨论】:

  • 那么您可以接受答案.. :) 。所以它也可以对其他人有所帮助。
  • 这是什么文件?
猜你喜欢
  • 2017-09-02
  • 1970-01-01
  • 2011-09-29
  • 1970-01-01
  • 2019-03-19
  • 2015-04-29
  • 2012-10-11
  • 2021-06-18
  • 2018-12-11
相关资源
最近更新 更多