Issue
I want to use adb
to install an APK with a lower version code, when a higher version code apk is already installed on the device.
I know I can bypass the downgrade flag using the following flags:
adb install -t -r -d <path_to_apk>
However this results in a different error:
Performing Streamed Install
adb: failed to install <apk_name> Failure [-26: Package <package_name> new target SDK 7 doesn't support runtime permissions but the old target SDK 29 does.]
I understand that the apk cannot be overwritten because the current target SDK (29) supports runtime permissions, but the new apk's target SDK (7) does not.
I've seen macOS apps that manage to downgrade the same app that I'm trying to, but I don't know how. Is there a flag I can use to bypass this limitation?
Solution
I ended up taking a slightly different approach:
First I uninstalled the apk with the following command:
abd uninstall -k <path_to_apk>
The -k
flag ensures that the app data in still kept on the device.
After that I installed the APK with the lower version code, using the following flags:
abd install -r -d <path_to_apk>
Trying to install the APK without the -r -d
flags will not work, even if the previous APK was uninstalled.
Answered By - user3673952
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.