awardak
awardak

Reputation: 322

Download Android APK file from Fabric Beta

Is it possible to download the Android APK file from Fabric Beta? We have multiple releases uploaded.

Upvotes: 11

Views: 7551

Answers (4)

wei wang
wei wang

Reputation: 225

Mesut's answer is correct. Just to make it more clear.

  1. adb shell pm path ${package_name}

  2. adb pull /data/app/${package_name_2}/base.apk

In the second command, the value ${package_name_2}/base.apk is from the first command. Sometimes it's not exactly the package name.

In my case, it's ${package_name}-1/base.apk

Upvotes: 1

Mesut GUNES
Mesut GUNES

Reputation: 7401

Late answer but someone may need this. You can download it in a hacky way from devices that apps install by Beta or any way:

Connect the device to your computer and run the following command, ensure that you have configured the adb correctly:

adb shell pm list packages | grep xyz          # get the package name of the app
adb shell pm path app.xyz.stg                  # get the path of the app
adb pull /data/app/app.xyz.stg/base.apk .      # pull the app to PWD

the name of the app is base.apk, change it to xyz. This can be used for the same device.

Upvotes: 7

Farrukh Najmi
Farrukh Najmi

Reputation: 5316

If you just want to download a specific build, say "1.0(143)" then you can choose that build in the beta app and download it.

If your need is to upload multiple apks from same build (say an apk for each deployment environment such as prevalidation, validation, production) then you need to setup your gradle to define productFlavors for each deployment environment like this:

android {
    ...
    flavorDimensions "deploymentEnvironment"

    productFlavors {
        prevalidation {
            dimension "deploymentEnvironment"
        }
        validation {
            dimension "deploymentEnvironment"
        }
        production {
            dimension "deploymentEnvironment"
        }
    }
    ...
}

Then you publish multiple APKs from the same build (one for each target deployment environment) to the same Fabric project using following gradle tasks as illustrative examples. Actual tasks depend on the variants defined for your project:

./gradlew -s assemblePrevalidationRelease assembleValidationRelease ./gradlew -s crashlyticsUploadDistributionPrevalidationRelease crashlyticsUploadDistributionValidationRelease

The Fabric console beta page does show both apks and you can choose to download and install one or the other. The only missing part is that both variants are listed as exactly the same (since they have the same versionName and versionCode). This could easily be solved if Fabric console shows the actual apk name in addition to the version / build info. I would love for the awesome Fabric team to address this small feature request sometime soon.

Until then a workaround I use is to identify the build based on order in Fabric beta console (risky but works) and put the target deployment info in the release notes for each apk in Fabric for a given build.

Upvotes: -1

Mike Bonnell
Mike Bonnell

Reputation: 16239

Mike from Fabric here. We currently don't provide a way to download the .APK, they are only provided via the Beta by Crashlytics apps.

Upvotes: 8

Related Questions