简体   繁体   中英

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.

I tried the way " How to rename android-debug.apk ".However, it doesn't work in Cordova 6.1.1.

Help me, Thank you.

Create a cordova hook wich triggeres on "after_build" and rename the file.

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

You can change .apk file name like this.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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