Skip to content

Commit 94db792

Browse files
authored
feat: add mobile:startLogsBroadcast and mobile:stopLogsBroadcast (#988)
* feat: add mobile:startLogsBroadcast and mobile:stopLogsBroadcast * add description about startLogsBroadcast and stopLogsBroadcast
1 parent ffbb4f2 commit 94db792

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,14 @@ Name | Type | Required | Description | Example
16321632
mode | string | yes | One of the supported UI mode names: `night` or `car`. | night
16331633

16341634

1635+
### mobile: startLogsBroadcast
1636+
1637+
Starts Android logcat broadcast websocket on the same host and port where Appium server is running at `/ws/session/:sessionId:/appium/logcat` endpoint. The method will return immediately if the web socket is already listening. Each connected webcoket listener will receive logcat log lines as soon as they are visible to Appium. Read [Using Mobile Execution Commands to Continuously Stream Device Logs with Appium](https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium) for more details.
1638+
1639+
### mobile: stopLogsBroadcast
1640+
1641+
Stops the previously started logcat broadcasting websocket server. This method will return immediately if no server is running. Read [Using Mobile Execution Commands to Continuously Stream Device Logs with Appium](https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium) for more details.
1642+
16351643
## Backdoor Extension Usage
16361644

16371645
Espresso driver allows to directly invoke a method from your application under test using `mobile: backdoor` extension. If `target` is set to `application` then methods will be invoked on the application class. If target is set to `activity` then methods will be invoked on the current application activity. If target is set to `element` then methods will be invoked on the selected view element. Only 'public' methods can be invoked ('open' modifier is necessary in Kotlin). The following primitive types are supported for method arguments: "int", "boolean", "byte", "short", "long", "float", "char". Object wrappers over primitive types with fully qualified names "java.lang.*" are also supported: "java.lang.CharSequence", "java.lang.String", "java.lang.Integer", "java.lang.Float", "java.lang.Double", "java.lang.Boolean", "java.lang.Long", "java.lang.Short", "java.lang.Character", etc.

lib/commands/execute.js

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ export async function executeMobile (mobileCommand, opts = {}) {
121121

122122
setUiMode: 'mobileSetUiMode',
123123
getUiMode: 'mobileGetUiMode',
124+
125+
startLogsBroadcast: 'mobileStartLogsBroadcast',
126+
stopLogsBroadcast: 'mobileStopLogsBroadcast',
124127
};
125128

126129
if (!_.has(mobileCommandsMapping, mobileCommand)) {

0 commit comments

Comments
 (0)