Force reinstall of Android app

Force reinstall of Android app

I rolled back the package version on an update that went out, and since then every install has failed. The previous package version also does not show the previous package version installed anymore, yet all still have the old version of our internal apk installed. I was able to get one of the remote devices by sending an uninstall script to the failed device, then clicked "Retry Profile Installation", and this updated the apk properly. However, this has one glaring flaw: by doing this, I lose all of the preferences stored in the app, which presents a problem with so many devices out in the field. Is there a way to force a reinstall of the apk? MobiControl doesn't want to install over the existing application, even though the new one has a higher version number and version code.

8 Answers

Order By:   Standard | Newest | Votes
Matt Dermody | posted this 25 June 2018

I have always included a pre-install script in my Android APK deployments that uninstalls any pre-existing versions of the app with the same Android package name (com.x.y...). This helps to account for any strange situation like the app being pre-installed when the device was enrolled or somehow manually installed through a sideload. You sending the uninstall script before the attempted retry is effectively performing the same process but has the side effect of wiping the app data as you mentioned. 

  • 0
  • 0
Raymond, Chan | posted this 26 June 2018

In-place upgrade/downgrade of Apps on Android+ platform is possible in most cases, if the correct procedure is followed.  However, some glitches may sometimes be present. depending on the MobiControl server/agent version, device brand/version, etc.  By "in-place", I meant only the app itself is modified, and all the user's application data on the device remain untouched.  This is usually the most desirable upgrade/downgrade option, as no IT administrator wants to receive complaints from end-users that their customization or other app specific data on the device are lost after the app executable gets updated.

 

Please provide more details on your implementation:

- Mobicontrol server version and build number

- Android+ device brand and Android firmware version

- Device agent version and build number

 

Please note that I am extremely busy these two days and may not have time to reply.

 

 

  • 0
  • 0
Edgar Gomez | posted this 26 June 2018

If the package doesn't work and you are in a hurry, try a sync rule sending the APK to devices  and running a script to install it after download.

 

  • 0
  • 0
Pride | posted this 26 June 2018

@Raymond,

Mobicontrol Version:

Make and Model: Janam XT2

Build Number: 87.10

Device Agent: 13.5.0.1088

  • 0
  • 0
Pride | posted this 26 June 2018

@Matt

You've done this and are positive it doesn't wipe user data? It would be catastrophic to do so

  • 0
  • 0
Raymond, Chan | posted this 02 July 2018

Successful in-place app update procedure depends on the platform, app types, and options chosen in the corresponding rule/configuration.  If some old devices do not need the update,  extra steps might be needed to make sure their deployed old version of the app are not affected.   I sometimes spend over 2 hours of training to my customers just on this topic to make sure they can perform their required update right for different scenarios.  Otherwise, user data for the target app have to be removed together when the binary of the old version get uninstalled,  making seamless in-place update not possible.   

 

For Android+/Android Enterprise apk deployed with .pcg package deployment rule,  As Soti support team recently gave some basic information in another thread:

  https://discussions.soti.net/thread/how-to-update-package-apk-on-multiple-device/

I do not have to repeat similar information here.  Please note that the advanced options chosen when creating your pcg's and the options configured in your profile/package-deployment rule may also affect the result.

 

In general, no explicit "uninstall" command should be used in  pre-/post- install/uninstall script for in-place update.  Also, thoroughly test the changes on some device(s) (preferably same brand/model/firmware and agent versions as the production devices)  in a test device-group (say in one newly created test child-group under any of the original production device-group affected)  before applying the changes to the production device groups.

 

   

 

  • 0
  • 0
Ciaran Byrne | posted this 05 July 2018

I had a similar issue yesterday. I rolled out an updated package and every install failed after it. I then tried to uninstall the app but I could no longer uninstall it. Under applications the "Installed" status was greyed out with no option to uninstall. I tried to send uninstall scripts but they didn't work either.

 

In the end my only solution was to rename my app (it's still in test), and to create an entirely new package. The new install works fine. I have since made some updates and they are working too. The old app is not on the phone but does show greyed out under applications, weird !

 

Here's one key takeaway - I was previously updating my package wrong. Every-time I was doing an update I was removing the old package and adding a new one. Now I change the apk in the same package, increment the version number and upload it. It displays that there is a new version, which I save and assign. It performs an app update not a fresh install.

 

  • 1
  • 1
Support Staff | posted this 06 July 2018

Hi Pride, 

 

Ciaran is correct as to how to update an application version using packages.   This method retains the application data and updates the application. This way the application is just updated not removed and reinstalled. 

 

"Now I change the apk in the same package, increment the version number and upload it. It displays that there is a new version, which I save and assign. It performs an app update not a fresh install."

 

In your circumstances it sounds like reverting back from the current version to the previous version may have left your packages in a conflicted state, especially if the package was removed prematurely.   

 

*Note in the MobiControl DB, packages are not removed but rather have a status assigned to them, such as installed, uninstalled, revoked etc.  You cannot have 2 versions of the same application/package as installed, one needs to be inactive, otherwise it will cause the grey out effect or lack of current status being displayed.  I would recommend having a Support Tech work with you to ensure their status's are correct in your DB, if this continues.  

 

However if you test the update method as outlined in the previous post you may be able to fix this yourself in MobiControl.  I would suggest trying to clearly specify which version should be installed on your test device and then performing the update to the correct version.

 

Hopefully this helps,

 

 

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback