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

feat: add checkVersion option for mobile:installApp #736

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,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

Expand Down Expand Up @@ -801,6 +803,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

Expand All @@ -812,6 +815,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

Expand Down
2 changes: 1 addition & 1 deletion lib/execute-method-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export const executeMethodMap = {
command: 'mobileInstallApp',
params: {
required: ['appPath'],
optional: ['timeout', 'keepData'],
optional: ['timeout', 'allowTestPackages', 'useSdcard', 'grantPermissions', 'replace', 'checkVersion'],
},
},
'mobile: clearApp': {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"appium-adb": "^12.0.0",
"appium-android-driver": "^8.2.0",
"appium-android-driver": "^8.4.0",
"appium-chromedriver": "^5.6.28",
"appium-uiautomator2-server": "^6.0.7",
"asyncbox": "^3.0.0",
Expand Down
Loading