问题
Every time I deploy a new version of an Android app with Xamarin Studio the app gets uninstalled first and then installed again. This is causing some problems for me because I'm using XPrivacy on my devices.
I wonder if there is a way to simply deploy the new version without uninstalling them in the first place (like when deploying with Android Studio or Eclipse)?
回答1:
When building and deploying apps to your device, by default Xamarin will delete any existing application data/cache. This is not always ideal as it resets your data as if it were a fresh install.
To preserve data, you need to update the option:
In Xamarin Studio, select Tools > Options > Projects > Android... Check "Preserve data/cache between application deploys"
In Visual Studio, select Tools > Options > Xamarin > Android Settings... Check "Preserve data/cache between application deploys"
Once you do this, any shared preferences or data files created in the local application folder will remain.
来源:https://stackoverflow.com/questions/26364316/how-to-prevent-android-app-from-getting-uninstalled-during-deployment-with-xamar