feat(app-management): add is-app-installed tool and improve list-apps#169
feat(app-management): add is-app-installed tool and improve list-apps#169KazuCocoa merged 9 commits intoappium:mainfrom
Conversation
|
fyi: |
| packageName: s.trim(), | ||
| appName: '', | ||
| })); | ||
| if (platform === PLATFORM.android) { |
There was a problem hiding this comment.
With updating uia2 driver with 6.9.0 in this package.json, here can be simplified with:
return await (driver as AndroidUiautomator2Driver).mobileListApps();
There was a problem hiding this comment.
cool i think good catch, check the new implementation 🦔
| const result = await execute(driver, 'mobile: listApps', {}); | ||
| if (result && typeof result === 'object' && !Array.isArray(result)) { | ||
| return normalizeListAppsResult( | ||
| result as Record<string, Record<string, unknown> | undefined> | ||
| ); |
There was a problem hiding this comment.
I think here also can be simplified with:
return await (driver as XCUITestDriver).mobileListApps();
| const platform = getPlatformName(driver); | ||
| const params = | ||
| platform === PLATFORM.android ? { appId: id } : { bundleId: id }; | ||
| const raw = await execute(driver, 'mobile: isAppInstalled', params); |
There was a problem hiding this comment.
Similar to mobileListApps, here can call:
https://github.com/appium/appium-xcuitest-driver/blob/6087bb4caa15ed5998c17f5cda1658d5fb5f32d0/lib/commands/app-management.ts#L236 for xcuitest
https://github.com/appium/appium-uiautomator2-driver/blob/5f4600593953fea521cefdb66b5bc5225ad41111/lib/uiautomator2.ts#L273 for android. So,
await (driver as XCUITestDriver).isAppInstalled(id)
await (driver as AndroidUiautomator2Driver).adb.isAppInstalled(id)
# for the `isRemoteDriverSession` case. It returns true or false.
await execute(driver, 'mobile: isAppInstalled', params);
KazuCocoa
left a comment
There was a problem hiding this comment.
lgtm entirely. I left last one comment
package.json
Outdated
| "scripts": { | ||
| "build": "rimraf dist tsconfig.tsbuildinfo && tsc -b && chmod +x dist/index.js && npm run copy-docs", | ||
| "copy-docs": "mkdir -p dist/tools/documentation/uploads && cp -f src/tools/documentation/uploads/documents.json dist/tools/documentation/uploads/documents.json 2>/dev/null || true", | ||
| "build": "rimraf dist tsconfig.tsbuildinfo && tsc -b && node -e \"require('fs').chmodSync('dist/index.js', 0o755)\" && npm run copy-docs", |
There was a problem hiding this comment.
The last one. Could you revert these changes?
## [1.17.0](v1.16.1...v1.17.0) (2026-02-21) ### Features * **app-management:** add is-app-installed tool and improve list-apps ([#169](#169)) ([625a364](625a364))
|
🎉 This PR is included in version 1.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Added
appium_is_app_installedtool and fixedappium_list_appsfor Android.The new
is_app_installedtool checks if an app is installed using driver methods for local sessions (iOS usesisAppInstalled(), Android usesadb.isAppInstalled()), with a fallback to themobile: isAppInstalledcommand for remote sessions.For
list_apps, I fixed a bug where Android'smobile: listAppsreturns an array of package names but the code was expecting an object, so it was returning an empty list. Now it properly handles the array response. Also cleaned up the implementation to usedriver.mobileListApps()directly instead of the ADB fallback since the driver method works fine now.Updated the uiautomator2 driver to 6.9.0 as requested.