Matt Baker
Matt Baker

Reputation: 3454

Xamarin - Preserve application data/cache on device between deploys not working

I'm trying to perform a simple upgrade test from Production (from Google Play) -> Current (my local code attached to a debugger), but the Preserve application data/cache on device between deploys feature in both Xamarin for Visual Studio and Xamarin Studio appears to be completely broken. Even if the version number of the app I'm debugging/deploying is greater than the one currently installed it will completely remove it before installing the new one, blowing away the shared settings/data/cache. Obviously this effectively makes it a clean install and not an upgrade. Here is the scenario I'm trying to test:

  1. Install current version from Google Play, login, do some stuff.
  2. Debug the latest code on the device, taking over the shared settings/data/cache from the previous version (this built debug binary is signed with the exact same certificate as Production)

No matter what I do it keeps performing a complete Remove/Install with each debug session. In fact, Xamarin Studio is so confused that it thinks the app installed from Google Play matches the version I'm trying to deploy, so doesn't deploy the new version at all.

Any ideas on how to fix or work around this issue? Maybe by calling adb directly to do deployments by hand?

Upvotes: 2

Views: 1106

Answers (1)

Pierre
Pierre

Reputation: 9052

https://stackoverflow.com/a/50714956/1876355

If your device is rooted, it can be the cause of your problem.

Database (Sqlite-net) do not persist between build on Monodroid

The device was somewhat rooted (or not). I have read somewhere that this might be an issue so I followed these steps:

  1. Installed KingoRoot
  2. Device "was already rooted" (broken), but rooted it with KingoRoot, then crashed
  3. Tried to root it again with success
  4. UnRooted the device with SuperUser
  5. Uninstalled KingoRoot
  6. Now data is preserved when compiling/debugging to the device.

Upvotes: 1

Related Questions