When push apk...update or uninstall/install?

Solved
JW

Hi.

android tc52x 

mobicontrol 15.6

I use mc pkg studio to push new apk updates for our app.
I use js for my prei (and other) scripts.

A practical example would best describe my question.

App (apk) current version on scanner: v2.0

New app (apk) version to be pushed: v3.0

Sometimes it will uninstall v2.0 then install v3.0

Other times it will update v2.0 to v3.0.

Updates seem to really crash it so then I have to manually uninstall then Force Package Reinstallation from Soti.

1. What determines whether it does an uninstall or update?
2. What js command can I use to force our application to uninstall first (in the prei cmd script)?

thanks!

2 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
2 years ago

For a clean upgrade to work the following criteria must be met:

  • App is the same bundle id as the existing (eg. com.x.y)
  • New version of the App is incremented higher than the version existing on the device.
  • New version of the App has the same signing signature of the prior version.
  • The new version of the App is added to a newer higher version of the same Package that was used to install the prior version.

If those criteria can't be maintained then the prior version of the app has to be uninstalled before the new version can be installed. You can use a Pre-install script with the format uninstall com.x.y to uninstall any pre-existing versions of the app before the new version is installed. Note that when an app is uninstalled completely using this process that any app cache and scoped storage will also be wiped in the process and any permissions that the app may have been manually granted will also be reset in the process. 

Solution
JW
James Wisecup
2 years ago

Thank you Matt.

JW
James Wisecup
2 years ago

Followup...

Well, that was unfortunate....

The uninstall com.x.y  does not work in js.  It does work in Legacy.