简体   繁体   English

Cordova6.1 .1:如何重命名android-debug.apk

[英]Cordova6.1 .1: how to rename android-debug.apk

I am using Cordova(6.1.1) to create an android app.However, the output app build name is always "android-debug.apk".How to change the generated name. 我正在使用Cordova(6.1.1)创建一个android应用程序。但是,输出应用程序的构建名称始终为“ android-debug.apk”。如何更改生成的名称。

I tried the way " How to rename android-debug.apk ".However, it doesn't work in Cordova 6.1.1. 我尝试了“ 如何重命名android-debug.apk ”的方法。但是,它在Cordova 6.1.1中不起作用。

Help me, Thank you. 帮帮我,谢谢。

Create a cordova hook wich triggeres on "after_build" and rename the file. 在“ after_build”上创建一个cordova挂钩触发器,然后重命名该文件。

https://cordova.apache.org/docs/en/7.x/guide/appdev/hooks/index.html https://cordova.apache.org/docs/en/7.x/guide/appdev/hooks/index.html

You can change .apk file name like this. 您可以像这样更改.apk文件名。

buildTypes {
    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            outputFileName = new File("test.apk")
        }
    }
}

Add this code on your project, project/platforms/android/app/build.gradle please check this docs: https://developer.android.com/studio/build/build-variants.html#build-types 在您的项目project/platforms/android/app/build.gradle上添加此代码,请检查以下文档: https : //developer.android.com/studio/build/build-buildants.html#build-types

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM