欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android 如何修改APK的默認(rèn)名稱

 更新時(shí)間:2017年02月03日 09:30:28   投稿:lqh  
這篇文章主要介紹了Android 如何修改APK的默認(rèn)名稱的相關(guān)資料,需要的朋友可以參考下

Android 如何修改APK的默認(rèn)名稱

用Android Studio 打包App時(shí)生成的名稱默認(rèn)是 app-release.apk(已簽名) 或 app-debug.apk(測試版)。

要想打包時(shí)修改默認(rèn)名稱,可以打開在build.gradle(module:app)文件,在android{}中添加如下代碼:

android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
      def outputFile = output.outputFile
      if (outputFile != null && outputFile.name.endsWith('.apk')) {
        //這里修改apk文件名
        def fileName = outputFile.name.replace("app", "你想要的名字")
        output.outputFile = new File(outputFile.parent, fileName)
      }
    }
  }

寫完直接點(diǎn)擊工具欄Build中的 BuildApk 或是使用簽名打包即可。

效果圖如下:

這里寫圖片描述

其實(shí),還可以是這樣:右鍵—>重命名 。

這里寫圖片描述

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

最新評論