0

Is there anyway to install a debug or release build on Android app without removing the current released (non-debug) version installed from the Google Play app store? I am using USB debugging and adb to install.

An app I developed and released may crash because of the data contained in the database. In order to find exactly why my app is crashing, I need to maintain the state of the database installed on this user's device so I can debug into the problem.

Is there anyway to build a debug version that can be installed on top of my release build?

Or some way to force apk to install on a non-rooted Android device? I guess this would be a security concern, so I expect the answer is no.

I cannot use adb to install a new release build on top of the app store installed release? Why is it incompatible? Does the store add some special signing?

    adb -d install -r 1.1-universal-release.apk
Performing Streamed Install
adb: failed to install  1.1-universal-release.apk.apk: 
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: 
Package com.mycompany.myapp signatures 
do not match the previously installed version; ignoring!]

Using USB and adb logcat identified some clues as to the cause of the crash. I was hoping I could make my fix, and run app with the original data, to verify fix and, and confirm cause of the crash.

Thanks in advance for any suggestions,

Ed of the Mountain
  • 5,219
  • 4
  • 46
  • 54
  • How are you managing release keys for the app? – Morrison Chang Sep 16 '19 at 20:31
  • My build.gradle has a **signingConfigs.release**. My **buildTypes.release** includes **signingConfigs.release**. My **buildTypes.debug** does NOT include any signingConfigs. However, I cannot even install a new signed release build on top of the release build installed from Google Play??? **"INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.subsite.utiliguard signatures do not match previously installed version**; ignoring!"** – Ed of the Mountain Sep 18 '19 at 13:32
  • 1
    What I meant was are you using [Google Play App-Signing](https://developer.android.com/studio/publish/app-signing#app-signing-google-play) or do you [manage the release key](https://developer.android.com/studio/publish/app-signing#sign_release)? – Morrison Chang Sep 18 '19 at 16:53
  • I have App Signing by Google Play enabled for this app. While this made release management easy, I cannot debug database issues if app was installed from Google Play. Is only solution to install a debug build on top of a Google Play release build, to mange the release key myself? Thank you for your time. – Ed of the Mountain Sep 19 '19 at 17:14
  • Correct, owning the release key and not having Google manage means you can sign any APK with release key and side-load. One path I thought of but have not tried, is to build a Play Store 'alpha release' version of the app which when you enable a special developer mode that you've written which will extract out the database. You'll have to be careful to not promote that version to release, and it will require the device owner to be in the 'alpha' program. You should test on different APK before trying it out for real. If it does work please add as self answer. – Morrison Chang Sep 19 '19 at 17:34
  • Thank you! That might work. I guess once I release my alpha to production, I can kick everybody out of the alpha test group except myself and use it to see if a bug fix works or not. However, I think using "Google Play App Signing" is less flexible and makes it impossible to source code debug into the database installed on an app released from the Google Play store. Thank you for your help. If you wish to make this the answer I will gladly accept it. Thank your for your patience and thoughtful replies. – Ed of the Mountain Sep 19 '19 at 18:03
  • If I** stop using app signing by Google Play**, I can no longer upload **Android App Bundles**, the recommended app publishing format. I think that is a trade-off worth making in order to be enable install of debug builds on top of a Google Play installed release app in order to source code debug into database or other problems. – Ed of the Mountain Sep 19 '19 at 19:20
  • Found out about 'internal test channel' which may be what you need. See answer. – Morrison Chang Sep 19 '19 at 19:21

1 Answers1

1

As you've indicated in the comments you are using Google Play App Signing rather than self managing the release key. While this does have advantages in key management, this also means that you can't sign an APK and side-load it over your existing Google Play APK. Also Google Play App Signing cannot be reverted for released apps.

One path is to have a modified version of the App which will have a hidden developer mode for either extracting out data (the database you are interested in) or hitting development/test servers.

Such a version you'll have to be careful of promoting the APK improperly, but while previously it may have been an 'alpha' channel release (now called Closed Release), Google Play now has an internal test channel which will require the device owner to be a part of to receive the 'internal test' APK. This appears to handle development issues such as debugging & QA as it appears to have a quicker release cycle. Do note that the registered user for an 'internal test' has additional limitations.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • 1
    I think **self managing the release key** has debugging benefits. My concern is that Google may require use of **Google Play App Signing** and **Android App Bundle files (*.aab)** in the future. – Ed of the Mountain Sep 20 '19 at 19:07