简体   繁体   English

如何重命名android-debug.apk

[英]How to rename android-debug.apk

I am using Cordova (5.1.1) and ionic framework to create my android. 我正在使用Cordova(5.1.1)和离子框架来创建我的android。 However, when I try to build the apk, why the file name is always "android-debug.apk" ? 但是,当我尝试构建apk时,为什么文件名始终是“android-debug.apk”? Is there any way to rename it ? 有没有办法重命名它?

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

In the hello\\config.xml, name tag is defined as HelloWorld already: 在hello \\ config.xml中,name标签已经定义为HelloWorld:

Please help. 请帮忙。

Yes you can change the name of the apk try this 是的你可以改变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
                )
            }
        }
    }
}

Also sync and clean the project after this. 此后还要同步和清理项目。

Edit 编辑

Write this in build.gradle file. 在build.gradle文件中写下这个。

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

相关问题 Cordova6.1 .1:如何重命名android-debug.apk - Cordova6.1 .1: how to rename android-debug.apk Android 应用程序通过调试安装运行良好,但在创建应用程序的情况下崩溃(android-debug.apk) - Android App running fine via debugging installation but crashes in case of created app(android-debug.apk) 为什么我的APK文件显示app-debug.apk? 如何重命名? - Why does my APK file say app-debug.apk? How do I rename it? 调试模式下的Android APK - Android apk in debug mode 如何使用调试APK测试Android Pay? - How to test Android Pay with a debug APK? 如何在 android 工作室中调试您的 Release APK 或任何 APK - How to debug your Release APK or any APK in android studio 如何建立一个调试android apk,所以BuildConfig.DEBUG是真的吗? - How to build a debug android apk so BuildConfig.DEBUG is true? 如何在Android中以编程方式获取重命名.APK文件名? - How to get rename .APK file name in Android programmatically? 如何让Android Gradle构建写入调试APK的文件 - How to have Android Gradle build write a file that goes into the debug APK 如何从 Linux 命令行在 Genymotion 模拟器上调试 Android APK? - How to debug an Android APK on a Genymotion emulator from a Linux command line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM