Skip to content
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

Is it possible to install apk without the option '-r'? #85

Open
thinkhy opened this issue Nov 12, 2017 · 2 comments
Open

Is it possible to install apk without the option '-r'? #85

thinkhy opened this issue Nov 12, 2017 · 2 comments

Comments

@thinkhy
Copy link
Member

thinkhy commented Nov 12, 2017

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.

@sorccu
Copy link
Member

sorccu commented Nov 12, 2017

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.

@thinkhy
Copy link
Member Author

thinkhy commented Nov 14, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants