From a0438b8993524f0e216a2c661cae6dd66c21611c Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 8 Feb 2024 19:45:23 -0800 Subject: [PATCH] feat: add checkVersion option for mobile:installApp (#980) --- README.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c7ca218..ea772292 100644 --- a/README.md +++ b/README.md @@ -918,6 +918,8 @@ The call is ignored if the app is not installed. Name | Type | Required | Description | Example --- | --- | --- | --- | --- appId | string | yes | The identifier of the application package to be removed | `my.app.id` +timeout | number | no | The count of milliseconds to wait until the app is terminated. 20000ms by default. | 1500, 0 +keepData | boolean | no | Set to true in order to keep the application data and cache folders after uninstall. | true #### Returned Result @@ -946,6 +948,7 @@ True if the app has been successfully terminated. ### mobile: installApp Installs the given application package to the device under test. +It might raise the `INSTALL_FAILED_VERSION_DOWNGRADE` error if the installation was a version downgrade. #### Arguments @@ -957,6 +960,7 @@ allowTestPackages | boolean | no | Set to true in order to allow test packages i useSdcard | boolean | no | Set to true to install the app on sdcard instead of the device memory. false by default | true grantPermissions | boolean | no | Set to true in order to grant all the permissions requested in the application's manifest automatically after the installation is completed under Android 6+. The targetSdkVersion in the application manifest must be greater or equal to 23 and the Android version on the device under test must be greater or equal to Android 6 (API level 23) to grant permissions. Applications whose targetSdkVersion is lower than or equal to 22 must be reisntalled to grant permissions for Android 6+ devices. false by default | true replace | boolean | no | Set it to false if you don't want the application to be upgraded/reinstalled if it is already present on the device, but throw an error instead. true by default | false +checkVersion | boolean | no | Set to true, in order to skip the application installation if the device under test has a greater or equal to the application version. It may help to avoid `INSTALL_FAILED_VERSION_DOWNGRADE` error and unnecessary installation. | true ### mobile: clearApp diff --git a/package.json b/package.json index f0f71ffc..77742b86 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ ], "dependencies": { "appium-adb": "^12.0.0", - "appium-android-driver": "^8.3.0", + "appium-android-driver": "^8.4.0", "asyncbox": "^3.0.0", "bluebird": "^3.5.0", "io.appium.settings": "^5.7.2",