Package io.appium.java_client.android
Interface ListensToLogcatMessages
- All Superinterfaces:
ExecutesMethod
- All Known Implementing Classes:
AndroidDriver,FlutterAndroidDriver
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddLogcatConnectionListener(Runnable handler) Adds a new log broadcasting connection handler.default voidaddLogcatDisconnectionListener(Runnable handler) Adds a new log broadcasting disconnection handler.default voidaddLogcatErrorsListener(Consumer<Throwable> handler) Adds a new log broadcasting errors handler.default voidaddLogcatMessagesListener(Consumer<String> handler) Adds a new log messages broadcasting handler.default voidRemoves all existing logcat handlers.default voidStart logcat messages broadcast via web socket.default voidstartLogcatBroadcast(String host) Start logcat messages broadcast via web socket.default voidstartLogcatBroadcast(String host, int port) Start logcat messages broadcast via web socket.default voidStops logcat messages broadcast via web socket.Methods inherited from interface io.appium.java_client.ExecutesMethod
execute, execute
-
Method Details
-
getLogcatClient
StringWebSocketClient getLogcatClient() -
startLogcatBroadcast
default void startLogcatBroadcast()Start logcat messages broadcast via web socket. This method assumes that Appium server is running on localhost and is assigned to the default port (4723). -
startLogcatBroadcast
Start logcat messages broadcast via web socket. This method assumes that Appium server is assigned to the default port (4723).- Parameters:
host- the name of the host where Appium server is running
-
startLogcatBroadcast
Start logcat messages broadcast via web socket.- Parameters:
host- the name of the host where Appium server is runningport- the port of the host where Appium server is running
-
addLogcatMessagesListener
Adds a new log messages broadcasting handler. Several handlers might be assigned to a single server. Multiple calls to this method will cause such handler to be called multiple times.- Parameters:
handler- a function, which accepts a single argument, which is the actual log message
-
addLogcatErrorsListener
Adds a new log broadcasting errors handler. Several handlers might be assigned to a single server. Multiple calls to this method will cause such handler to be called multiple times.- Parameters:
handler- a function, which accepts a single argument, which is the actual exception instance
-
addLogcatConnectionListener
Adds a new log broadcasting connection handler. Several handlers might be assigned to a single server. Multiple calls to this method will cause such handler to be called multiple times.- Parameters:
handler- a function, which is executed as soon as the client is successfully connected to the web socket
-
addLogcatDisconnectionListener
Adds a new log broadcasting disconnection handler. Several handlers might be assigned to a single server. Multiple calls to this method will cause such handler to be called multiple times.- Parameters:
handler- a function, which is executed as soon as the client is successfully disconnected from the web socket
-
removeAllLogcatListeners
default void removeAllLogcatListeners()Removes all existing logcat handlers. -
stopLogcatBroadcast
default void stopLogcatBroadcast()Stops logcat messages broadcast via web socket.
-