Skip to content

Commit 7ec9f8c

Browse files
feat: Add a wrapper over status bar commands (#615)
1 parent df73d09 commit 7ec9f8c

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,31 @@ Example output for different data types:
13291329
]
13301330
```
13311331

1332+
### mobile: statusBar
1333+
1334+
Performs commands on the system status bar. A thin wrapper over `adb shell cmd statusbar` CLI. Works on Android 8 (Oreo) and newer. Available since driver version 2.25
1335+
1336+
#### Arguments
1337+
1338+
Name | Type | Required | Description | Example
1339+
--- | --- | --- | --- | ---
1340+
command | string | yes | One of [supported status bar commands](#status-bar-commands). | expandNotifications
1341+
component | string | no | The name of the tile component. It is only required for (add\|remove\|click)Tile commands. | com.package.name/.service.QuickSettingsTileComponent
1342+
1343+
#### Status Bar Commands
1344+
1345+
- expandNotifications: Open the notifications panel.
1346+
- expandSettings: Open the notifications panel and expand quick settings if present.
1347+
- collapse: Collapse the notifications and settings panel.
1348+
- addTile: Add a TileService of the specified component.
1349+
- removeTile: Remove a TileService of the specified component.
1350+
- clickTile: Click on a TileService of the specified component.
1351+
- getStatusIcons: Returns the list of status bar icons and the order they appear in. Each list item is separated with a new line character.
1352+
1353+
#### Returned Result
1354+
1355+
The actual downstream command output. It depends on the selected command and might be empty.
1356+
13321357

13331358
## Applications Management
13341359

lib/commands/general.js

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ extensions.executeMobile = async function (mobileCommand, opts = {}) {
165165

166166
getPerformanceData: 'mobileGetPerformanceData',
167167
getPerformanceDataTypes: 'getPerformanceDataTypes',
168+
169+
statusBar: 'mobilePerformStatusBarCommand',
168170
};
169171

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"dependencies": {
5959
"@babel/runtime": "^7.0.0",
6060
"appium-adb": "^9.11.0",
61-
"appium-android-driver": "^5.12.1",
61+
"appium-android-driver": "^5.13.0",
6262
"appium-chromedriver": "^5.3.1",
6363
"appium-uiautomator2-server": "^5.7.2",
6464
"asyncbox": "^2.3.1",

0 commit comments

Comments
 (0)