Skip to content

Commit

Permalink
fix: uninstall installed uia2 servers if they were greater than on-go…
Browse files Browse the repository at this point in the history
…ing session
  • Loading branch information
KazuCocoa committed Jun 21, 2024
1 parent 0464741 commit 060a432
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/uiautomator2.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ class UiAutomator2Server {
);

this.log.debug(`Server packages status: ${JSON.stringify(packagesInfo)}`);
// Enforce server packages reinstall if any of the packages is not installed, while the other is
const shouldUninstallServerPackages = (packagesInfo.some(({installState}) => installState === this.adb.APP_INSTALL_STATE.NOT_INSTALLED)
// Enforce server packages reinstall if any of the packages is not installed,
// or newer one than uia2 driver is going to use.
const shouldUninstallServerPackages = (packagesInfo.some(({installState}) => installState === this.adb.APP_INSTALL_STATE.NEWER_VERSION_INSTALLED)
&& !packagesInfo.every(({installState}) => installState === this.adb.APP_INSTALL_STATE.NOT_INSTALLED));
// Install must always follow uninstall. Also, perform the install if
// any of server packages is not installed or is outdated
Expand Down

0 comments on commit 060a432

Please sign in to comment.