我们打包可能有很多buildType,比如正式、测试等,为了快速区分构件类型,需要用显眼的文字或者图标来区分。
1.在app的build.gradle中的buildTypes中添加manifestPlaceholders
buildTypes {
release {
manifestPlaceholders = [
icon: "@drawable/icon_app_logo",
name: "@string/app_main_name"
]
}
debug {
manifestPlaceholders = [
icon: "@drawable/icon_app_logo_test",
name: "@string/app_main_name_test"
]
}
}
2.manifest中使用
<application
android:icon="${icon}"
android:label="${name}">
...
</application>
网友评论