我对构建类型
和产品风格
有基本的了解,但仍然一无所知。
这是我的情况:
有dev
、stg
和prod
三个环境,分别有不同的domain server。我想在开发时在同一台设备上安装所有不同环境的 apk。
我们可以通过applicationIdSuffix
设置不同的build types
,使它们获得不同的application id,并且可以安装在同一台设备上。
现在,我需要为我们的测试人员将 apk 上传到 Google Play。但是 Google Play 需要一个唯一的应用程序 ID。所以我必须删除后缀。
我只需要apk
com.android.example
(带有用于 Google Play 的开发服务器)com.android.example
(带有用于 Google Play 的 stg 服务器)com.android.example
(带有用于 Google Play 的产品服务器)com.android.example.dev
(用于开发的开发服务器)com.android.example.stg
(用于开发的 stg 服务器)com.android.example.prod
(带有用于开发的 prod 服务器。)
最佳答案
你可以有不同的选择。
例如,使用 6 种不同的构建类型并为它们分别设置 applicationId 和服务器 url 等其他参数。
buildtype1 : com.android.example(with dev server for Google Play)
buildtype2 : com.android.example(with stg server for Google Play)
buildtype3 : com.android.example(with prod server for Google Play)
buildtype4 : com.android.example.dev(with dev server for Development)
buildtype5 : com.android.example.stg(with stg server for Development)
buildtype6 : com.android.example.prod(with prod server for Development.)
关于android - 根据环境设置不同的application id是否需要发布到google play,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53541368/