-
Notifications
You must be signed in to change notification settings - Fork 541
Try to preserve the app cache on uninstall. #10019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Context #9259 Due to various reasons `adb` may not be able to preserve the app cache on uninstall. To work around this we have to use the `-k` flag to uninstall the app when using the `cmd package uninstall` call. This will keep the app data and cache on the device. However this might also fail. So in that case we need to completely uninstall the app and then install it again.
Can we make |
the |
note that the very first call to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking what "fast deployment" does for this in Debug mode, and I can only find the pm
command:
Should we only use the pm
command here instead of trying two commands? Just to make Debug & Release consistent?
We can also update this target, which is maybe not used:
android/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Lines 3017 to 3030 in 747041d
<Target Name="_Uninstall"> | |
<AndroidAdb | |
ToolExe="$(AdbToolExe)" | |
ToolPath="$(AdbToolPath)" | |
AdbTarget="$(AdbTarget)" | |
Command="uninstall" | |
Arguments="$(_AndroidPackage)" | |
/> | |
</Target> | |
<Target Name="Uninstall" | |
Condition="'$(AndroidApplication)'!='' And $(AndroidApplication)" | |
DependsOnTargets="$(UninstallDependsOnTargets)"> | |
</Target> |
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
So just use the |
You might review what |
Context #9259
Due to various reasons
adb
may not be able to preserve the app cache on uninstall. To work around this we have to use the-k
flag to uninstall the app when using thecmd package uninstall
call. This will keep the app data and cache on the device.However this might also fail. So in that case we need to completely uninstall the app and then install it again.