From 4fb04117036c69740a304a538e8baa6a7df90163 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Fri, 20 Nov 2026 14:58:54 +0100 Subject: [PATCH 1/4] chore: deprecate the logs broadcasting listeners --- docs/selenium-bridge.md | 21 +++++++++++++++++++ .../java_client/android/AndroidDriver.java | 3 +++ .../android/ListensToLogcatMessages.java | 11 +++++++++- .../io/appium/java_client/ios/IOSDriver.java | 3 +++ .../ios/ListensToSyslogMessages.java | 11 +++++++++- .../java_client/ws/CanHandleConnects.java | 7 +++++++ .../java_client/ws/CanHandleDisconnects.java | 7 +++++++ .../java_client/ws/CanHandleErrors.java | 7 +++++++ .../java_client/ws/CanHandleMessages.java | 6 ++++++ .../java_client/ws/StringWebSocketClient.java | 7 +++++++ 10 files changed, 81 insertions(+), 2 deletions(-) diff --git a/docs/selenium-bridge.md b/docs/selenium-bridge.md index a820653ce..04d102052 100644 --- a/docs/selenium-bridge.md +++ b/docs/selenium-bridge.md @@ -54,3 +54,24 @@ The next `asRemoteWebDriver` call opens a new connection. To customize the HTTP client that opens the WebSocket connection, use the `asRemoteWebDriver` overload that takes a Selenium `HttpClient.Factory`. It creates a new Selenium driver with its own connection on every call. + +### Migrating from the logs broadcast + +`ListensToLogcatMessages` (Android) and `ListensToSyslogMessages` (iOS), together with the `StringWebSocketClient` +they are based on, are deprecated, as the Appium drivers deprecated the `mobile: startLogsBroadcast` and +`mobile: stopLogsBroadcast` extensions. Subscribe to the BiDi `log.entryAdded` event instead. It is delivered over the +connection of the session, so there is no need to know the host and the port of the Appium server. + +```java +var driver = new AndroidDriver(serverUrl, options.enableBiDi()); +var selenium = SeleniumBridge.asRemoteWebDriver(driver); +try (var logInspector = new LogInspector(selenium)) { + logInspector.onLog(entry -> System.out.println(entry.getText())); + // ... +} finally { + selenium.closeBiDi(); +} +``` + +The `type` of a log entry tells the source of the log, for example `logcat` or `syslog`, and its level is one of +`debug`, `info`, `warn` and `error`. diff --git a/src/main/java/io/appium/java_client/android/AndroidDriver.java b/src/main/java/io/appium/java_client/android/AndroidDriver.java index 53d5ca502..d0d351994 100644 --- a/src/main/java/io/appium/java_client/android/AndroidDriver.java +++ b/src/main/java/io/appium/java_client/android/AndroidDriver.java @@ -49,6 +49,8 @@ /** * Android driver implementation. */ +// The deprecated logs broadcasting API is removed in the next major release +@SuppressWarnings("removal") public class AndroidDriver extends AppiumDriver implements PressesKey, SupportsRotation, @@ -224,6 +226,7 @@ public AndroidBatteryInfo getBatteryInfo() { } @Override + @Deprecated(since = "11.1.0", forRemoval = true) public synchronized StringWebSocketClient getLogcatClient() { if (logcatClient == null) { logcatClient = new StringWebSocketClient(getHttpClient()); diff --git a/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java b/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java index d3fcb5c7c..ea1c2ebc0 100644 --- a/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java +++ b/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java @@ -29,7 +29,16 @@ import static io.appium.java_client.service.local.AppiumServiceBuilder.DEFAULT_APPIUM_PORT; -/** Provides listening to logcat messages broadcast via web socket. */ +/** + * Provides listening to logcat messages broadcast via web socket. + * + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. + */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public interface ListensToLogcatMessages extends ExecutesMethod { /** * Gets the web socket client used for receiving logcat messages. diff --git a/src/main/java/io/appium/java_client/ios/IOSDriver.java b/src/main/java/io/appium/java_client/ios/IOSDriver.java index 274f62c8a..a9bac7a76 100644 --- a/src/main/java/io/appium/java_client/ios/IOSDriver.java +++ b/src/main/java/io/appium/java_client/ios/IOSDriver.java @@ -51,6 +51,8 @@ /** * iOS driver implementation. */ +// The deprecated logs broadcasting API is removed in the next major release +@SuppressWarnings("removal") public class IOSDriver extends AppiumDriver implements SupportsContextSwitching, SupportsRotation, @@ -252,6 +254,7 @@ class IOSAlert implements Alert { } @Override + @Deprecated(since = "11.1.0", forRemoval = true) public synchronized StringWebSocketClient getSyslogClient() { if (syslogClient == null) { syslogClient = new StringWebSocketClient(getHttpClient()); diff --git a/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java b/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java index 4558f5d23..9d32248bc 100644 --- a/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java +++ b/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java @@ -29,7 +29,16 @@ import static io.appium.java_client.service.local.AppiumServiceBuilder.DEFAULT_APPIUM_PORT; -/** Provides the ability to listen to syslog messages broadcast by the Appium server via web socket. */ +/** + * Provides the ability to listen to syslog messages broadcast by the Appium server via web socket. + * + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. + */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public interface ListensToSyslogMessages extends ExecutesMethod { /** diff --git a/src/main/java/io/appium/java_client/ws/CanHandleConnects.java b/src/main/java/io/appium/java_client/ws/CanHandleConnects.java index 6bdd92cd0..d02a0a181 100644 --- a/src/main/java/io/appium/java_client/ws/CanHandleConnects.java +++ b/src/main/java/io/appium/java_client/ws/CanHandleConnects.java @@ -20,7 +20,14 @@ /** * Supports handlers of the web socket connection events. + * + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public interface CanHandleConnects { /** diff --git a/src/main/java/io/appium/java_client/ws/CanHandleDisconnects.java b/src/main/java/io/appium/java_client/ws/CanHandleDisconnects.java index 69fbff5ad..c69e05bf0 100644 --- a/src/main/java/io/appium/java_client/ws/CanHandleDisconnects.java +++ b/src/main/java/io/appium/java_client/ws/CanHandleDisconnects.java @@ -20,7 +20,14 @@ /** * Supports handlers of the web socket disconnection events. + * + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public interface CanHandleDisconnects { /** diff --git a/src/main/java/io/appium/java_client/ws/CanHandleErrors.java b/src/main/java/io/appium/java_client/ws/CanHandleErrors.java index e7bbb058e..f6037d07e 100644 --- a/src/main/java/io/appium/java_client/ws/CanHandleErrors.java +++ b/src/main/java/io/appium/java_client/ws/CanHandleErrors.java @@ -21,7 +21,14 @@ /** * Supports handlers of the web socket errors. + * + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public interface CanHandleErrors { /** diff --git a/src/main/java/io/appium/java_client/ws/CanHandleMessages.java b/src/main/java/io/appium/java_client/ws/CanHandleMessages.java index 6e72f4da7..4a730bd48 100644 --- a/src/main/java/io/appium/java_client/ws/CanHandleMessages.java +++ b/src/main/java/io/appium/java_client/ws/CanHandleMessages.java @@ -23,7 +23,13 @@ * Supports handlers of the web socket messages. * * @param the message type + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public interface CanHandleMessages { /** * Returns a list of all registered web socket messages handlers. diff --git a/src/main/java/io/appium/java_client/ws/StringWebSocketClient.java b/src/main/java/io/appium/java_client/ws/StringWebSocketClient.java index fb75f9409..9e988a598 100644 --- a/src/main/java/io/appium/java_client/ws/StringWebSocketClient.java +++ b/src/main/java/io/appium/java_client/ws/StringWebSocketClient.java @@ -31,7 +31,14 @@ /** * A web socket client that handles text messages. + * + * @deprecated The logs broadcasting web socket of the Appium drivers is deprecated and will be removed + * together with this API. Subscribe to the BiDi {@code log.entryAdded} event instead, see the + * Selenium + * bridge documentation. */ +@Deprecated(since = "11.1.0", forRemoval = true) +@SuppressWarnings("removal") public class StringWebSocketClient implements WebSocket.Listener, CanHandleMessages, CanHandleErrors, CanHandleConnects, CanHandleDisconnects { private final List> messageHandlers = new CopyOnWriteArrayList<>(); From 0d44e06d23e40ba2cb08fc879e3929c7d1829556 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Fri, 20 Nov 2026 15:05:28 +0100 Subject: [PATCH 2/4] ci: skip the Flutter e2e tests if no driver supports the stable server --- .github/scripts/resolve-appium-versions.mjs | 27 ++++++++++++++++----- .github/workflows/ci.yml | 24 +++++++++++------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/.github/scripts/resolve-appium-versions.mjs b/.github/scripts/resolve-appium-versions.mjs index cb7682c4d..8806134f4 100644 --- a/.github/scripts/resolve-appium-versions.mjs +++ b/.github/scripts/resolve-appium-versions.mjs @@ -1,9 +1,10 @@ // Resolves the versions of the Appium server and of a driver to install in e2e jobs. -// Usage: node resolve-appium-versions.mjs [--stable] +// Usage: node resolve-appium-versions.mjs [--stable] [--skip-if-unsupported] // The beta server is used if it is newer than the latest stable one and some driver version supports it, // otherwise the latest stable server is used. The driver is the newest version whose `appium` peer range // accepts the chosen server (stable only, unless a beta server is used). With --stable the stable server is forced. -// The result is written to the step outputs `server` and `driver`. +// If no driver version supports the server, the script fails, unless --skip-if-unsupported is set: then it +// only reports `supported=false`. The result is written to the step outputs `server`, `driver` and `supported`. import {execFile} from 'node:child_process'; import {appendFile} from 'node:fs/promises'; import {createRequire} from 'node:module'; @@ -44,9 +45,12 @@ function pickDriver(driverVersions, server, includePrereleases) { async function main(args) { const stableOnly = args.includes('--stable'); - const [serverPackage, driverPackage] = args.filter((arg) => arg !== '--stable'); + const skipIfUnsupported = args.includes('--skip-if-unsupported'); + const [serverPackage, driverPackage] = args.filter((arg) => !arg.startsWith('--')); if (!serverPackage || !driverPackage) { - throw new Error('Usage: resolve-appium-versions.mjs [--stable] '); + throw new Error( + 'Usage: resolve-appium-versions.mjs [--stable] [--skip-if-unsupported] ', + ); } const [{latest, beta}, driverTags, driverVersions] = await Promise.all([ @@ -61,7 +65,18 @@ async function main(args) { const server = betaDriver ? beta : latest; const driver = betaDriver ?? pickDriver(driverVersions, latest, false); if (!driver) { - throw new Error(`No ${driverPackage} version supports ${serverPackage}@${server}`); + const message = `No ${driverPackage} version supports ${serverPackage}@${server}`; + if (!skipIfUnsupported) { + throw new Error(message); + } + console.log(`::warning::${message}, the dependent steps are skipped`); + if (process.env.GITHUB_STEP_SUMMARY) { + await appendFile(process.env.GITHUB_STEP_SUMMARY, `${message}, the dependent steps are skipped\n`); + } + if (process.env.GITHUB_OUTPUT) { + await appendFile(process.env.GITHUB_OUTPUT, `server=${server}\nsupported=false\n`); + } + return; } const summary = [ @@ -74,7 +89,7 @@ async function main(args) { await appendFile(process.env.GITHUB_STEP_SUMMARY, `${summary}\n`); } if (process.env.GITHUB_OUTPUT) { - await appendFile(process.env.GITHUB_OUTPUT, `server=${server}\ndriver=${driver}\n`); + await appendFile(process.env.GITHUB_OUTPUT, `server=${server}\ndriver=${driver}\nsupported=true\n`); } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec118457d..f86ac8eb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,16 +137,22 @@ jobs: appium ${{ (matrix.e2e-tests == 'android' || matrix.e2e-tests == 'flutter-android') && 'appium-uiautomator2-driver' || 'appium-xcuitest-driver' }} + # The Flutter driver may not support the stable server yet, the Flutter tests are skipped then + - name: Resolve Flutter Integration driver version + id: flutter-driver + if: startsWith(matrix.e2e-tests, 'flutter') + run: node .github/scripts/resolve-appium-versions.mjs --stable --skip-if-unsupported appium appium-flutter-integration-driver + - name: Install Appium run: npm install --location=global appium@${{ steps.appium-versions.outputs.server }} - name: Install UIA2 driver - if: matrix.e2e-tests == 'android' || matrix.e2e-tests == 'flutter-android' + if: (matrix.e2e-tests == 'android' || matrix.e2e-tests == 'flutter-android') && steps.flutter-driver.outputs.supported != 'false' run: appium driver install uiautomator2@${{ steps.appium-versions.outputs.driver }} - name: Install Flutter Integration driver - if: matrix.e2e-tests == 'flutter-android' || matrix.e2e-tests == 'flutter-ios' - run: appium driver install appium-flutter-integration-driver --source npm + if: (matrix.e2e-tests == 'flutter-android' || matrix.e2e-tests == 'flutter-ios') && steps.flutter-driver.outputs.supported != 'false' + run: appium driver install appium-flutter-integration-driver@${{ steps.flutter-driver.outputs.driver }} --source npm - name: Run Android E2E tests if: matrix.e2e-tests == 'android' @@ -160,7 +166,7 @@ jobs: target: ${{ env.ANDROID_EMU_TARGET }} - name: Run Flutter Android E2E tests - if: matrix.e2e-tests == 'flutter-android' + if: matrix.e2e-tests == 'flutter-android' && steps.flutter-driver.outputs.supported != 'false' uses: reactivecircus/android-emulator-runner@v2 with: script: ./gradlew e2eFlutterTest -Pplatform="android" -PflutterApp=${{ env.FLUTTER_ANDROID_APP }} @@ -171,13 +177,13 @@ jobs: target: ${{ env.ANDROID_EMU_TARGET }} - name: Select Xcode - if: matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios' + if: (matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios') && steps.flutter-driver.outputs.supported != 'false' uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: "${{ env.XCODE_VERSION }}" - name: Prepare iOS simulator - if: matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios' + if: (matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios') && steps.flutter-driver.outputs.supported != 'false' uses: futureware-tech/simulator-action@v6 with: model: "${{ env.IOS_DEVICE_NAME }}" @@ -187,11 +193,11 @@ jobs: shutdown_after_job: false - name: Install XCUITest driver - if: matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios' + if: (matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios') && steps.flutter-driver.outputs.supported != 'false' run: appium driver install xcuitest@${{ steps.appium-versions.outputs.driver }} - name: Download prebuilt WDA - if: matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios' + if: (matrix.e2e-tests == 'ios' || matrix.e2e-tests == 'flutter-ios') && steps.flutter-driver.outputs.supported != 'false' run: appium driver run xcuitest download-wda -- --platform=ios --kind=sim --outdir=$(dirname "$PREBUILT_WDA_PATH") - name: Run iOS E2E tests @@ -199,5 +205,5 @@ jobs: run: ./gradlew e2eIosTest - name: Run Flutter iOS E2E tests - if: matrix.e2e-tests == 'flutter-ios' + if: matrix.e2e-tests == 'flutter-ios' && steps.flutter-driver.outputs.supported != 'false' run: ./gradlew e2eFlutterTest -Pplatform="ios" -PflutterApp=${{ env.FLUTTER_IOS_APP }} From 150f11749d26acb9ea34885e9a21238347e49e48 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Fri, 20 Nov 2026 15:18:45 +0100 Subject: [PATCH 3/4] fix: address review feedback on the logs broadcast deprecation Deprecate the interface methods themselves so callers get removal warnings, and fix the BiDi migration example (generic log entry, syslog type). Co-Authored-By: Claude Sonnet 5.5 --- docs/selenium-bridge.md | 6 +++--- .../java_client/android/ListensToLogcatMessages.java | 10 ++++++++++ .../java_client/ios/ListensToSyslogMessages.java | 10 ++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/selenium-bridge.md b/docs/selenium-bridge.md index 04d102052..ed970a93e 100644 --- a/docs/selenium-bridge.md +++ b/docs/selenium-bridge.md @@ -66,12 +66,12 @@ connection of the session, so there is no need to know the host and the port of var driver = new AndroidDriver(serverUrl, options.enableBiDi()); var selenium = SeleniumBridge.asRemoteWebDriver(driver); try (var logInspector = new LogInspector(selenium)) { - logInspector.onLog(entry -> System.out.println(entry.getText())); + logInspector.onGenericLog(entry -> System.out.println(entry.getText())); // ... } finally { selenium.closeBiDi(); } ``` -The `type` of a log entry tells the source of the log, for example `logcat` or `syslog`, and its level is one of -`debug`, `info`, `warn` and `error`. +The `type` of a log entry tells the source of the log, for example `syslog` (used for both the Android logcat +and the iOS syslog), and its level is one of `debug`, `info`, `warn` and `error`. diff --git a/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java b/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java index ea1c2ebc0..e94655240 100644 --- a/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java +++ b/src/main/java/io/appium/java_client/android/ListensToLogcatMessages.java @@ -45,6 +45,7 @@ public interface ListensToLogcatMessages extends ExecutesMethod { * * @return the logcat web socket client. */ + @Deprecated(since = "11.1.0", forRemoval = true) StringWebSocketClient getLogcatClient(); /** @@ -52,6 +53,7 @@ public interface ListensToLogcatMessages extends ExecutesMethod { * This method assumes that Appium server is running on localhost and * is assigned to the default port (4723). */ + @Deprecated(since = "11.1.0", forRemoval = true) default void startLogcatBroadcast() { startLogcatBroadcast("127.0.0.1"); } @@ -62,6 +64,7 @@ default void startLogcatBroadcast() { * * @param host the name of the host where Appium server is running */ + @Deprecated(since = "11.1.0", forRemoval = true) default void startLogcatBroadcast(String host) { startLogcatBroadcast(host, DEFAULT_APPIUM_PORT); } @@ -72,6 +75,7 @@ default void startLogcatBroadcast(String host) { * @param host the name of the host where Appium server is running * @param port the port of the host where Appium server is running */ + @Deprecated(since = "11.1.0", forRemoval = true) default void startLogcatBroadcast(String host, int port) { var remoteWebDriver = (AppiumRemoteWebDriver) this; URL serverUrl = ((AppiumCommandExecutor) remoteWebDriver.getCommandExecutor()).getAddressOfRemoteServer(); @@ -90,6 +94,7 @@ default void startLogcatBroadcast(String host, int port) { * * @param handler a function, which accepts a single argument, which is the actual log message */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addLogcatMessagesListener(Consumer handler) { getLogcatClient().addMessageHandler(handler); } @@ -102,6 +107,7 @@ default void addLogcatMessagesListener(Consumer handler) { * * @param handler a function, which accepts a single argument, which is the actual exception instance */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addLogcatErrorsListener(Consumer handler) { getLogcatClient().addErrorHandler(handler); } @@ -115,6 +121,7 @@ default void addLogcatErrorsListener(Consumer handler) { * @param handler a function, which is executed as soon as the client is successfully * connected to the web socket */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addLogcatConnectionListener(Runnable handler) { getLogcatClient().addConnectionHandler(handler); } @@ -128,6 +135,7 @@ default void addLogcatConnectionListener(Runnable handler) { * @param handler a function, which is executed as soon as the client is successfully * disconnected from the web socket */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addLogcatDisconnectionListener(Runnable handler) { getLogcatClient().addDisconnectionHandler(handler); } @@ -135,6 +143,7 @@ default void addLogcatDisconnectionListener(Runnable handler) { /** * Removes all existing logcat handlers. */ + @Deprecated(since = "11.1.0", forRemoval = true) default void removeAllLogcatListeners() { getLogcatClient().removeAllHandlers(); } @@ -142,6 +151,7 @@ default void removeAllLogcatListeners() { /** * Stops logcat messages broadcast via web socket. */ + @Deprecated(since = "11.1.0", forRemoval = true) default void stopLogcatBroadcast() { removeAllLogcatListeners(); CommandExecutionHelper.executeScript(this, "mobile: stopLogsBroadcast"); diff --git a/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java b/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java index 9d32248bc..d6bbc406f 100644 --- a/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java +++ b/src/main/java/io/appium/java_client/ios/ListensToSyslogMessages.java @@ -46,6 +46,7 @@ public interface ListensToSyslogMessages extends ExecutesMethod { * * @return the syslog web socket client */ + @Deprecated(since = "11.1.0", forRemoval = true) StringWebSocketClient getSyslogClient(); /** @@ -53,6 +54,7 @@ public interface ListensToSyslogMessages extends ExecutesMethod { * This method assumes that Appium server is running on localhost and * is assigned to the default port (4723). */ + @Deprecated(since = "11.1.0", forRemoval = true) default void startSyslogBroadcast() { startSyslogBroadcast("localhost"); } @@ -63,6 +65,7 @@ default void startSyslogBroadcast() { * * @param host the name of the host where Appium server is running */ + @Deprecated(since = "11.1.0", forRemoval = true) default void startSyslogBroadcast(String host) { startSyslogBroadcast(host, DEFAULT_APPIUM_PORT); } @@ -73,6 +76,7 @@ default void startSyslogBroadcast(String host) { * @param host the name of the host where Appium server is running * @param port the port of the host where Appium server is running */ + @Deprecated(since = "11.1.0", forRemoval = true) default void startSyslogBroadcast(String host, int port) { var remoteWebDriver = (AppiumRemoteWebDriver) this; URL serverUrl = ((AppiumCommandExecutor) remoteWebDriver.getCommandExecutor()).getAddressOfRemoteServer(); @@ -91,6 +95,7 @@ default void startSyslogBroadcast(String host, int port) { * * @param handler a function, which accepts a single argument, which is the actual log message */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addSyslogMessagesListener(Consumer handler) { getSyslogClient().addMessageHandler(handler); } @@ -103,6 +108,7 @@ default void addSyslogMessagesListener(Consumer handler) { * * @param handler a function, which accepts a single argument, which is the actual exception instance */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addSyslogErrorsListener(Consumer handler) { getSyslogClient().addErrorHandler(handler); } @@ -116,6 +122,7 @@ default void addSyslogErrorsListener(Consumer handler) { * @param handler a function, which is executed as soon as the client is successfully * connected to the web socket */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addSyslogConnectionListener(Runnable handler) { getSyslogClient().addConnectionHandler(handler); } @@ -129,6 +136,7 @@ default void addSyslogConnectionListener(Runnable handler) { * @param handler a function, which is executed as soon as the client is successfully * disconnected from the web socket */ + @Deprecated(since = "11.1.0", forRemoval = true) default void addSyslogDisconnectionListener(Runnable handler) { getSyslogClient().addDisconnectionHandler(handler); } @@ -136,6 +144,7 @@ default void addSyslogDisconnectionListener(Runnable handler) { /** * Removes all existing syslog handlers. */ + @Deprecated(since = "11.1.0", forRemoval = true) default void removeAllSyslogListeners() { getSyslogClient().removeAllHandlers(); } @@ -143,6 +152,7 @@ default void removeAllSyslogListeners() { /** * Stops syslog messages broadcast via web socket. */ + @Deprecated(since = "11.1.0", forRemoval = true) default void stopSyslogBroadcast() { CommandExecutionHelper.executeScript(this, "mobile: stopLogsBroadcast"); } From d23f107a9c20dde15d730551e3ce919d99b773c8 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Sat, 21 Nov 2026 08:25:21 +0100 Subject: [PATCH 4/4] docs: filter syslog entries in the logs broadcast migration example Co-Authored-By: Claude Sonnet 5.5 --- docs/selenium-bridge.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/selenium-bridge.md b/docs/selenium-bridge.md index ed970a93e..1782851c2 100644 --- a/docs/selenium-bridge.md +++ b/docs/selenium-bridge.md @@ -66,12 +66,17 @@ connection of the session, so there is no need to know the host and the port of var driver = new AndroidDriver(serverUrl, options.enableBiDi()); var selenium = SeleniumBridge.asRemoteWebDriver(driver); try (var logInspector = new LogInspector(selenium)) { - logInspector.onGenericLog(entry -> System.out.println(entry.getText())); + logInspector.onGenericLog(entry -> { + if ("syslog".equals(entry.getType())) { + System.out.println(entry.getText()); + } + }); // ... } finally { selenium.closeBiDi(); } ``` -The `type` of a log entry tells the source of the log, for example `syslog` (used for both the Android logcat -and the iOS syslog), and its level is one of `debug`, `info`, `warn` and `error`. +The `type` of a log entry tells the source of the log. Filter by `syslog` (used for both the Android logcat +and the iOS syslog) to get the device log, as other types, like `crashlog`, are delivered to the same listener. +The level is one of `debug`, `info`, `warn` and `error`.