google play store - how to promote test app with different package name?
Asked Answered
C

1

1

This is a question about package names in android. I currently have two build flavors in gradle. Production and Staging.

I have created a google play store account and i want users to alpha and beta test my app. The staging app currenly has a package name of: com.mobile.myapp.staging while the production flavor has a package name of com.mobile.myapp.

so we have

com.mobile.myapp.staging vs com.mobile.myapp

in the end i clearly want to promote com.mobile.myapp to production not the staging. but i'd like the users to test with the staging variant for a long while (as its connected to staging apis . etc etc.)

How can i do this ? would i have to create two different apps in the google play store ? I am wondering if i have to do this as they both have different package names. They both will be signed with the same keystore. Please help.

my gradle file looks like this:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion project.ext.minimumSdkVersion
//check top level build.gradle  file for attributes -
targetSdkVersion 25
applicationId "com.mobile.myapp"
versionCode 150010203
versionName 1.2.3 
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

//renderscriptTargetApi 25
//renderscriptSupportModeEnabled true
multiDexEnabled true
}
buildTypes {
release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

dexOptions {
javaMaxHeapSize "6g"
}//for out of memory gc overhead error
lintOptions {
abortOnError false
}

productFlavors {

def STRING = "String"
def BOOLEAN = "boolean"
def TRUE = "true"
def FALSE = "false"
def FLAVOR = "FLAVOR"
def RETROFIT_LOG_ALL = "RETROFIT_LOG_ALL"
def BASE_ENDPOINT = "BASE_ENDPOINT"

staging {
    // applicationId "com.mobile.myapp.staging"
    buildConfigField STRING, BASE_ENDPOINT, '"https://api.flyingSaucerxx-staging.com"'
    buildConfigField BOOLEAN, RETROFIT_LOG_ALL, TRUE
    manifestPlaceholders = [appDrawerName: "FlyingSaucer-Staging"]
    applicationIdSuffix '.staging'
    versionNameSuffix '-STAGING'
}

prod {
    buildConfigField STRING, BASE_ENDPOINT, '"https://api.flyingSaucerxx.com"'
    buildConfigField BOOLEAN, RETROFIT_LOG_ALL, FALSE
    manifestPlaceholders = [appDrawerName: "FlyingSaucer"]
}
}
}

///.. dependencies below
Cruz answered 1/8, 2017 at 9:18 Comment(8)
#18492149Perisarc
You can do alpha and beta testing with com.mobile.myapp by uploading the apk to the Alpha and Beta testing section in the developer console. You don't need to create two variations of the same app. You're simply making things complicated.Eeg
the app is dealing with secure information etc. the business would like it first tested by users in the staging region. If they feel good about it then we will test on the production region. I dont see what you mean that i dont need to test two variations ?Cruz
why don't you use same package name and different endpoints for staging and production?Mononucleosis
using applicationIdSuffix '.staging' allowed me to have two different apps on the device thats why i was using it. let me check, one secCruz
@PratikPopat thanks. removing it gives me what i want but too bad now i cant have two app flavors installed at the same time as now they have the same package nameCruz
Same issue here, seems like there is no solution till today. A bit surprised google doesn't support this use case.Vitek
To summarize, gradle has the option to produce different ID's for staging and production. But it's virtually useless because you can't release the two versions? I must be missing something, is there a way for google play store to modify a bundle so when you promote it to production it can, for exemple, update the endpoints the app is using? Maybe the solution is to have two different apps, completely separated. One for production and one for staging?Kriskrischer
M
1

It is not possible to use different package names in Google Play Store for the same app.

So the only option you have is to change package name of your staging app to production one. And submit it to alpha/beta testers. And sure watch out to not promote it to production.

Another option is to use other delivery channels like hockeyapp or crashlitics beta.

Metamerism answered 1/8, 2017 at 9:36 Comment(2)
No offence, but I think it's possible to release the same app with similar package name if you use build flavours. Although, I haven't tried it.Pressley
@EndreBörcsök Eugen is saying its not possible with "different" package names.Cruz

© 2022 - 2024 — McMap. All rights reserved.