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

uninstall espresso server if the installed server version is newer #357

Closed
wants to merge 1 commit into from

Conversation

KazuCocoa
Copy link
Member

appium/appium-uiautomator2-driver#270 for Espresso.

installOrUpgrade includes the same, lower version and unknown cases. The only newer version does not exist in the method.

I considered implementing uninstallApk when installed app is NEWER_VERSION_INSTALLED in installOrUpgrade. But current behaviour is proper for the current method name. The cost of calling getApplicationInstallState is not considerable, I thought.

Thus, I add this way.

if (appState === this.adb.APP_INSTALL_STATE.NEWER_VERSION_INSTALLED) {
await this.adb.uninstallApk(TEST_APK_PKG);
}

await this.adb.installOrUpgrade(this.modServerPath, TEST_APK_PKG);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding the cost of getApplicationInstallState call - it is called inside installOrUpgrade for the second time. This means we should consider changing installOrUpgrade to install, like UIA2 driver does if the upgrade logic needs to be customized

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah..

@KazuCocoa
Copy link
Member Author

#358

@KazuCocoa KazuCocoa closed this Dec 18, 2018
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

Successfully merging this pull request may close these issues.

2 participants