简体   繁体   中英

Multiple APKs on single device

I am being asked by my QA team to give them different APKs pointing to different servers and they can install all of them on the same device so that they can compare it side by side.

I know it's impossible to have multiple APKs on the device without changing the package name. But then since the app uses services like GCM, they depend on package name and then we have to start doing changes on server to support debug builds.

I'm just generally curious to know how people around usually test the app, specially in the case above where you can have multiple servers that you may want to test on. Are there any specialised tools that you guys use? What's the best practice?

有一个仅调试屏幕,他们可以在其中选择要连接的服务器...

As per suggested by @Buddy you can do.

But I suggest you to take Two device and check side by side . As there no tool that can do that.

My team has 3 servers:

  1. Live server
  2. Smoke server
  3. Staging server

All three has the same code but different database and API. So When I release APK for testing I just change the applicationId in my build.gradle

Example:

For live server:

android {
compileSdkVersion 'Google Inc.:Glass Development Kit Preview:19'
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.company.glass.doc" //CHANGE APP-ID FROM HERE
    minSdkVersion 19
    targetSdkVersion 19
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}}

For smoke and staging server:

android {
compileSdkVersion 'Google Inc.:Glass Development Kit Preview:19'
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.company.glass.docinternal" //CHANGE APP-ID FROM HERE
    minSdkVersion 19
    targetSdkVersion 19
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}}

The respective server detects the appropriate APK using applicationId.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM