Skip to content

Commit 44f6272

Browse files
authored
Merge branch 'master' into appium3
2 parents 1783085 + ec0304c commit 44f6272

5 files changed

Lines changed: 51 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## [9.10.4](https://github.com/appium/appium-xcuitest-driver/compare/v9.10.3...v9.10.4) (2025-08-06)
2+
3+
### Bug Fixes
4+
5+
* Make sure session id is set before cleaning up socket handlers ([#2604](https://github.com/appium/appium-xcuitest-driver/issues/2604)) ([3c73836](https://github.com/appium/appium-xcuitest-driver/commit/3c738363c1c7bb6106d6b2584558a0891dd8a47c))
6+
7+
## [9.10.3](https://github.com/appium/appium-xcuitest-driver/compare/v9.10.2...v9.10.3) (2025-08-04)
8+
9+
### Miscellaneous Chores
10+
11+
* bump appium-ios-device to 2.9.0 ([#2603](https://github.com/appium/appium-xcuitest-driver/issues/2603)) ([69a6ca9](https://github.com/appium/appium-xcuitest-driver/commit/69a6ca95391b9dce74d8130fd818705a20ac073e))
12+
13+
## [9.10.2](https://github.com/appium/appium-xcuitest-driver/compare/v9.10.1...v9.10.2) (2025-08-03)
14+
15+
### Miscellaneous Chores
16+
17+
* leave wda version info or debugging ([#2602](https://github.com/appium/appium-xcuitest-driver/issues/2602)) ([b683532](https://github.com/appium/appium-xcuitest-driver/commit/b68353263eb7a8fb814a6dcbb8b532df3a40a799))
18+
19+
## [9.10.1](https://github.com/appium/appium-xcuitest-driver/compare/v9.10.0...v9.10.1) (2025-07-26)
20+
21+
### Miscellaneous Chores
22+
23+
* make appium-ios-remotexpc optional deps ([#2600](https://github.com/appium/appium-xcuitest-driver/issues/2600)) ([5d956cf](https://github.com/appium/appium-xcuitest-driver/commit/5d956cf1653e48d5f5dc699ae63a70c67c2499ed))
24+
125
## [9.10.0](https://github.com/appium/appium-xcuitest-driver/compare/v9.9.6...v9.10.0) (2025-07-25)
226

327
### Features

lib/commands/battery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export default {
1313
async mobileGetBatteryInfo() {
1414
let batteryInfoFromShimService;
1515
if (isIos18OrNewer(this.opts) && this.isRealDevice()) {
16-
const {Services} = await import('appium-ios-remotexpc');
1716
let remoteXPCConnection;
1817
try {
18+
const {Services} = await import('appium-ios-remotexpc');
1919
let { diagnosticsService, remoteXPC } = await Services.startDiagnosticsService(this.device.udid);
2020
remoteXPCConnection = remoteXPC;
2121
batteryInfoFromShimService = await diagnosticsService.ioregistry({

lib/driver.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,16 @@ export class XCUITestDriver extends BaseDriver {
946946
await markSystemFilesForCleanup(this.wda);
947947
}
948948

949+
// We don't restrict the version, but show what version of WDA is running on the device for debugging purposes.
950+
if (this.cachedWdaStatus?.build) {
951+
this.log.info(`WebDriverAgent version: '${this.cachedWdaStatus.build.version}'`);
952+
} else {
953+
this.log.warn(
954+
`WebDriverAgent does not provide any version information. ` +
955+
`This might indicate either a custom or an outdated build.`
956+
);
957+
}
958+
949959
// we expect certain socket errors until this point, but now
950960
// mark things as fully working
951961
this.wda.fullyStarted = true;
@@ -972,8 +982,8 @@ export class XCUITestDriver extends BaseDriver {
972982
this.logEvent('resetComplete');
973983
}
974984

975-
async deleteSession() {
976-
await removeAllSessionWebSocketHandlers(this.server, this.sessionId);
985+
async deleteSession(sessionId) {
986+
await removeAllSessionWebSocketHandlers.bind(this)();
977987

978988
for (const recorder of _.compact([
979989
this._recentScreenRecorder,
@@ -1049,7 +1059,7 @@ export class XCUITestDriver extends BaseDriver {
10491059

10501060
this.resetIos();
10511061

1052-
await super.deleteSession();
1062+
await super.deleteSession(sessionId);
10531063
}
10541064

10551065
async stop() {

lib/utils.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,18 +404,17 @@ async function encodeBase64OrUpload(localPath, remotePath = null, uploadOptions
404404
* Stops and removes all web socket handlers that are listening
405405
* in scope of the current session.
406406
*
407-
* @param {Object} server - The instance of NodeJs HTTP server,
408-
* which hosts Appium
409-
* @param {string|null} sessionId - The id of the current session
407+
* @this {XCUITestDriver}
408+
* @returns {Promise<void>}
410409
*/
411-
async function removeAllSessionWebSocketHandlers(server, sessionId) {
412-
if (!server || !_.isFunction(server.getWebSocketHandlers)) {
410+
export async function removeAllSessionWebSocketHandlers() {
411+
if (!this.sessionId || !_.isFunction(this.server?.getWebSocketHandlers)) {
413412
return;
414413
}
415414

416-
const activeHandlers = await server.getWebSocketHandlers(sessionId);
415+
const activeHandlers = await this.server.getWebSocketHandlers(this.sessionId);
417416
for (const pathname of _.keys(activeHandlers)) {
418-
await server.removeWebSocketHandler(pathname);
417+
await this.server.removeWebSocketHandler(pathname);
419418
}
420419
}
421420

@@ -538,7 +537,6 @@ export {
538537
printUser,
539538
getPIDsListeningOnPort,
540539
encodeBase64OrUpload,
541-
removeAllSessionWebSocketHandlers,
542540
isLocalHost,
543541
normalizePlatformVersion,
544542
clearLogs,
@@ -548,4 +546,5 @@ export {
548546
/**
549547
* @typedef {import('appium-xcode').XcodeVersion} XcodeVersion
550548
* @typedef {import('appium-ios-simulator').Simulator} Simulator
549+
* @typedef {import('./driver').XCUITestDriver} XCUITestDriver
551550
*/

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@
8181
"@appium/strongbox": "^0.x",
8282
"@colors/colors": "^1.6.0",
8383
"appium-idb": "^1.6.13",
84-
"appium-ios-device": "^2.8.0",
84+
"appium-ios-device": "^2.9.0",
8585
"appium-ios-simulator": "^6.2.2",
86-
"appium-ios-remotexpc": "^0.x",
87-
"appium-remote-debugger": "^13.1.0",
88-
"appium-webdriveragent": "^9.11.0",
86+
"appium-remote-debugger": "^13.1.1",
87+
"appium-webdriveragent": "^9.15.2",
8988
"appium-xcode": "^5.1.4",
9089
"async-lock": "^1.4.0",
9190
"asyncbox": "^3.0.0",
@@ -104,6 +103,9 @@
104103
"winston": "3.17.0",
105104
"ws": "^8.13.0"
106105
},
106+
"optionalDependencies": {
107+
"appium-ios-remotexpc": "^0.x"
108+
},
107109
"scripts": {
108110
"build": "tsc -b",
109111
"clean": "npm run build -- --clean",

0 commit comments

Comments
 (0)