Is it possible to install apk without the option '-r'?
When install apk using adbkit.install(serial, apk), it will push the apk to temp dir then install it with the shell command pm install -r remote_apk_file . But in my case the errors such as "Signature conflicts", "UID changes" and "Package downgrade" were encountered sometimes on a few devices, so I changed the code in adbkit/lib/adb/command/host-transport/install.js:
this._send("shell:pm install -r " + (this._escapeCompat(apk)));
==>
this._send("shell:pm install " + (this._escapeCompat(apk)));
Now the apk can be installed successfully for almost all the devices. Is there any other(elegant) way instead of changing code to install apk without the option '-r'? Thanks.
We need to allow flags to be passed it, then it can go away. Hoping someone could make a PR for that.
Sounds unlikely that those errors went away just by removing the -r flag, though.
I will try to make a PR this weekend :-)
Now I first clear app data and unisntall pkg, then install the apk, all the code is written with adbkit. It might be due to incomplete cleaning after uninstall pkg on some devices.