“使用 Gradle 实现 debug 与 release 不同 APP 名”的版本间差异

来自Silica Library | 間奏時光
跳到导航 跳到搜索
(创建页面,内容为“Category:Android 2020-03-22 00:15 == 使用 == <pre> android { ... buildTypes { debug { resValue "string", "app_name", "@string/app_…”)
 
 
第8行: 第8行:
    buildTypes {
    buildTypes {
      debug {
      debug {
        resValue "string", "app_name", "@string/app_name_debug"
        resValue "string", "app_name", "APP Debug Version"
        ...
        ...
      }
      }
      release {
      release {
        resValue "string", "app_name", "@string/app_name_release"
        resValue "string", "app_name", "APP Release Version"
        ...
        ...
      }
      }
第19行: 第19行:
</pre>
</pre>


   在 strings.xml 中 建立对应 app_name_debug 和 app_name_release 通过 Gradle  打包出 来的 debug 和 release 的同个 APP 就会不同名字 。<br>
    注意,记得 在 strings.xml 中 注释掉原有 app_name 条目 不然会 打包出 。<br>

2020年3月21日 (六) 16:34的最新版本

2020-03-22 00:15

使用

android {
    ...
    buildTypes {
        debug {
            resValue "string", "app_name", "APP Debug Version"
            ...
        }
        release {
            resValue "string", "app_name", "APP Release Version"
            ...
        }
    }
}

  注意,记得在 strings.xml 中注释掉原有的 app_name 条目,不然会打包出错。