appium-android-driver 7.8.2 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/build/lib/commands/app-management.d.ts +129 -5
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +433 -128
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +17 -4
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +32 -33
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/context/cache.d.ts +19 -0
- package/build/lib/commands/context/cache.d.ts.map +1 -0
- package/build/lib/commands/context/cache.js +32 -0
- package/build/lib/commands/context/cache.js.map +1 -0
- package/build/lib/commands/context/exports.d.ts +141 -0
- package/build/lib/commands/context/exports.d.ts.map +1 -0
- package/build/lib/commands/context/exports.js +351 -0
- package/build/lib/commands/context/exports.js.map +1 -0
- package/build/lib/commands/context/helpers.d.ts +98 -0
- package/build/lib/commands/context/helpers.d.ts.map +1 -0
- package/build/lib/commands/context/helpers.js +715 -0
- package/build/lib/commands/context/helpers.js.map +1 -0
- package/build/lib/commands/device/common.d.ts +23 -0
- package/build/lib/commands/device/common.d.ts.map +1 -0
- package/build/lib/commands/device/common.js +230 -0
- package/build/lib/commands/device/common.js.map +1 -0
- package/build/lib/commands/device/emulator-actions.d.ts +114 -0
- package/build/lib/commands/device/emulator-actions.d.ts.map +1 -0
- package/build/lib/commands/device/emulator-actions.js +197 -0
- package/build/lib/commands/device/emulator-actions.js.map +1 -0
- package/build/lib/commands/device/emulator-console.d.ts +7 -0
- package/build/lib/commands/device/emulator-console.d.ts.map +1 -0
- package/build/lib/commands/device/emulator-console.js +24 -0
- package/build/lib/commands/device/emulator-console.js.map +1 -0
- package/build/lib/commands/device/utils.d.ts +50 -0
- package/build/lib/commands/device/utils.d.ts.map +1 -0
- package/build/lib/commands/device/utils.js +238 -0
- package/build/lib/commands/device/utils.js.map +1 -0
- package/build/lib/commands/deviceidle.d.ts +8 -5
- package/build/lib/commands/deviceidle.d.ts.map +1 -1
- package/build/lib/commands/deviceidle.js +31 -37
- package/build/lib/commands/deviceidle.js.map +1 -1
- package/build/lib/commands/element.d.ts +99 -5
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +152 -116
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +12 -4
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +83 -78
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +42 -5
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +230 -194
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/find.d.ts +5 -4
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +7 -10
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +45 -0
- package/build/lib/commands/geolocation.d.ts.map +1 -0
- package/build/lib/commands/geolocation.js +182 -0
- package/build/lib/commands/geolocation.js.map +1 -0
- package/build/lib/commands/ime.d.ts +25 -5
- package/build/lib/commands/ime.d.ts.map +1 -1
- package/build/lib/commands/ime.js +59 -42
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/intent.d.ts +56 -5
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +135 -83
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +58 -4
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +119 -17
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/lock/exports.d.ts +301 -0
- package/build/lib/commands/lock/exports.d.ts.map +1 -0
- package/build/lib/commands/lock/exports.js +121 -0
- package/build/lib/commands/lock/exports.js.map +1 -0
- package/build/lib/commands/lock/helpers.d.ts +349 -0
- package/build/lib/commands/lock/helpers.d.ts.map +1 -0
- package/build/lib/commands/lock/helpers.js +375 -0
- package/build/lib/commands/lock/helpers.js.map +1 -0
- package/build/lib/commands/log.d.ts +59 -5
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +150 -140
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +16 -5
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +69 -58
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/memory.d.ts +9 -5
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +19 -24
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/misc.d.ts +42 -0
- package/build/lib/commands/misc.d.ts.map +1 -0
- package/build/lib/commands/misc.js +100 -0
- package/build/lib/commands/misc.js.map +1 -0
- package/build/lib/commands/network.d.ts +61 -5
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +196 -189
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/performance.d.ts +67 -27
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +105 -80
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +12 -6
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +65 -62
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +44 -5
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +131 -126
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/resources.d.ts +16 -0
- package/build/lib/commands/resources.d.ts.map +1 -0
- package/build/lib/commands/resources.js +91 -0
- package/build/lib/commands/resources.js.map +1 -0
- package/build/lib/commands/shell.d.ts +8 -5
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +29 -33
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +34 -6
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +166 -162
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +18 -13
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +68 -64
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/time.d.ts +14 -0
- package/build/lib/commands/time.d.ts.map +1 -0
- package/build/lib/commands/time.js +39 -0
- package/build/lib/commands/time.js.map +1 -0
- package/build/lib/commands/touch.d.ts +99 -6
- package/build/lib/commands/touch.d.ts.map +1 -1
- package/build/lib/commands/touch.js +399 -280
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/commands/types.d.ts +115 -3
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/doctor/checks.d.ts.map +1 -1
- package/build/lib/doctor/checks.js +4 -4
- package/build/lib/doctor/checks.js.map +1 -1
- package/build/lib/driver.d.ts +224 -27
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +232 -7
- package/build/lib/driver.js.map +1 -1
- package/build/lib/index.d.ts +1 -4
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +1 -13
- package/build/lib/index.js.map +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/method-map.d.ts +0 -23
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +0 -11
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/utils.d.ts +12 -0
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +38 -2
- package/build/lib/utils.js.map +1 -1
- package/lib/commands/app-management.js +470 -145
- package/lib/commands/appearance.js +29 -36
- package/lib/commands/context/cache.js +29 -0
- package/lib/commands/context/exports.js +379 -0
- package/lib/commands/context/helpers.js +802 -0
- package/lib/commands/device/common.js +264 -0
- package/lib/commands/device/emulator-actions.js +194 -0
- package/lib/commands/device/emulator-console.js +24 -0
- package/lib/commands/device/utils.js +285 -0
- package/lib/commands/deviceidle.js +31 -44
- package/lib/commands/element.js +149 -142
- package/lib/commands/execute.js +86 -87
- package/lib/commands/file-actions.js +249 -222
- package/lib/commands/find.ts +13 -19
- package/lib/commands/geolocation.js +179 -0
- package/lib/commands/ime.js +53 -45
- package/lib/commands/intent.js +149 -91
- package/lib/commands/keyboard.js +114 -17
- package/lib/commands/lock/exports.js +139 -0
- package/lib/commands/lock/helpers.js +379 -0
- package/lib/commands/log.js +170 -166
- package/lib/commands/media-projection.js +75 -70
- package/lib/commands/memory.js +17 -29
- package/lib/commands/misc.js +94 -0
- package/lib/commands/network.js +209 -223
- package/lib/commands/performance.js +88 -73
- package/lib/commands/permissions.js +83 -84
- package/lib/commands/recordscreen.js +171 -170
- package/lib/commands/resources.js +96 -0
- package/lib/commands/shell.js +28 -42
- package/lib/commands/streamscreen.js +207 -206
- package/lib/commands/system-bars.js +76 -77
- package/lib/commands/time.js +36 -0
- package/lib/commands/touch.js +442 -346
- package/lib/commands/types.ts +142 -10
- package/lib/doctor/checks.js +24 -16
- package/lib/driver.ts +454 -12
- package/lib/index.ts +1 -13
- package/lib/logger.js +1 -1
- package/lib/method-map.js +0 -11
- package/lib/utils.js +40 -3
- package/package.json +1 -1
- package/build/lib/commands/actions.d.ts +0 -8
- package/build/lib/commands/actions.d.ts.map +0 -1
- package/build/lib/commands/actions.js +0 -207
- package/build/lib/commands/actions.js.map +0 -1
- package/build/lib/commands/alert.d.ts +0 -8
- package/build/lib/commands/alert.d.ts.map +0 -1
- package/build/lib/commands/alert.js +0 -29
- package/build/lib/commands/alert.js.map +0 -1
- package/build/lib/commands/context.d.ts +0 -10
- package/build/lib/commands/context.d.ts.map +0 -1
- package/build/lib/commands/context.js +0 -431
- package/build/lib/commands/context.js.map +0 -1
- package/build/lib/commands/emu-console.d.ts +0 -7
- package/build/lib/commands/emu-console.d.ts.map +0 -1
- package/build/lib/commands/emu-console.js +0 -27
- package/build/lib/commands/emu-console.js.map +0 -1
- package/build/lib/commands/general.d.ts +0 -9
- package/build/lib/commands/general.d.ts.map +0 -1
- package/build/lib/commands/general.js +0 -293
- package/build/lib/commands/general.js.map +0 -1
- package/build/lib/commands/index.d.ts +0 -28
- package/build/lib/commands/index.d.ts.map +0 -1
- package/build/lib/commands/index.js +0 -57
- package/build/lib/commands/index.js.map +0 -1
- package/build/lib/commands/mixins.d.ts +0 -747
- package/build/lib/commands/mixins.d.ts.map +0 -1
- package/build/lib/commands/mixins.js +0 -19
- package/build/lib/commands/mixins.js.map +0 -1
- package/build/lib/helpers/android.d.ts +0 -163
- package/build/lib/helpers/android.d.ts.map +0 -1
- package/build/lib/helpers/android.js +0 -818
- package/build/lib/helpers/android.js.map +0 -1
- package/build/lib/helpers/index.d.ts +0 -7
- package/build/lib/helpers/index.d.ts.map +0 -1
- package/build/lib/helpers/index.js +0 -29
- package/build/lib/helpers/index.js.map +0 -1
- package/build/lib/helpers/types.d.ts +0 -122
- package/build/lib/helpers/types.d.ts.map +0 -1
- package/build/lib/helpers/types.js +0 -3
- package/build/lib/helpers/types.js.map +0 -1
- package/build/lib/helpers/unlock.d.ts +0 -32
- package/build/lib/helpers/unlock.d.ts.map +0 -1
- package/build/lib/helpers/unlock.js +0 -273
- package/build/lib/helpers/unlock.js.map +0 -1
- package/build/lib/helpers/webview.d.ts +0 -74
- package/build/lib/helpers/webview.d.ts.map +0 -1
- package/build/lib/helpers/webview.js +0 -442
- package/build/lib/helpers/webview.js.map +0 -1
- package/lib/commands/actions.js +0 -244
- package/lib/commands/alert.js +0 -34
- package/lib/commands/context.js +0 -507
- package/lib/commands/emu-console.js +0 -31
- package/lib/commands/general.js +0 -343
- package/lib/commands/index.ts +0 -54
- package/lib/commands/mixins.ts +0 -976
- package/lib/helpers/android.ts +0 -1153
- package/lib/helpers/index.ts +0 -6
- package/lib/helpers/types.ts +0 -136
- package/lib/helpers/unlock.ts +0 -329
- package/lib/helpers/webview.ts +0 -604
package/lib/commands/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {HTTPMethod, StringRecord} from '@appium/types';
|
|
2
|
-
import {InstallOptions, UninstallOptions} from 'appium-adb';
|
|
1
|
+
import type {HTTPMethod, StringRecord} from '@appium/types';
|
|
2
|
+
import type {InstallOptions, UninstallOptions} from 'appium-adb';
|
|
3
|
+
import type {AndroidDriverCaps} from '../driver';
|
|
3
4
|
|
|
4
5
|
export interface SwipeOpts {
|
|
5
6
|
startX: number;
|
|
@@ -186,12 +187,16 @@ export interface WebviewsMapping {
|
|
|
186
187
|
webview: string;
|
|
187
188
|
/**
|
|
188
189
|
* Webview information as it is retrieved by `/json/version` CDP endpoint
|
|
190
|
+
*
|
|
191
|
+
* This value becomes `undefined` when the retrieval failed.
|
|
189
192
|
*/
|
|
190
193
|
info?: StringRecord;
|
|
191
194
|
/**
|
|
192
195
|
* Webview pages list as it is retrieved by `/json/list` CDP endpoint
|
|
196
|
+
*
|
|
197
|
+
* This value becomes `undefined` when the retrieval failed.
|
|
193
198
|
*/
|
|
194
|
-
pages
|
|
199
|
+
pages?: StringRecord[];
|
|
195
200
|
/**
|
|
196
201
|
* An actual webview name for switching context.
|
|
197
202
|
*
|
|
@@ -1081,7 +1086,7 @@ export type SwipeAction = [
|
|
|
1081
1086
|
NonReleaseTouchAction,
|
|
1082
1087
|
NonReleaseTouchAction,
|
|
1083
1088
|
NonReleaseTouchAction,
|
|
1084
|
-
ReleaseTouchAction
|
|
1089
|
+
ReleaseTouchAction,
|
|
1085
1090
|
];
|
|
1086
1091
|
|
|
1087
1092
|
export type TouchDragAction = [NonReleaseTouchAction, NonReleaseTouchAction, ReleaseTouchAction];
|
|
@@ -1096,16 +1101,23 @@ export interface LockOpts {
|
|
|
1096
1101
|
|
|
1097
1102
|
export interface DeviceidleOpts {
|
|
1098
1103
|
/** The action name to execute */
|
|
1099
|
-
action: 'whitelistAdd'|'whitelistRemove';
|
|
1104
|
+
action: 'whitelistAdd' | 'whitelistRemove';
|
|
1100
1105
|
/** Either a single package or multiple packages to add or remove from the idle whitelist */
|
|
1101
|
-
packages?: string|string[];
|
|
1106
|
+
packages?: string | string[];
|
|
1102
1107
|
}
|
|
1103
1108
|
|
|
1104
1109
|
export interface SendTrimMemoryOpts {
|
|
1105
1110
|
/** The package name to send the `trimMemory` event to */
|
|
1106
1111
|
pkg: string;
|
|
1107
1112
|
/** The actual memory trim level to be sent */
|
|
1108
|
-
level:
|
|
1113
|
+
level:
|
|
1114
|
+
| 'COMPLETE'
|
|
1115
|
+
| 'MODERATE'
|
|
1116
|
+
| 'BACKGROUND'
|
|
1117
|
+
| 'UI_HIDDEN'
|
|
1118
|
+
| 'RUNNING_CRITICAL'
|
|
1119
|
+
| 'RUNNING_LOW'
|
|
1120
|
+
| 'RUNNING_MODERATE';
|
|
1109
1121
|
}
|
|
1110
1122
|
|
|
1111
1123
|
export interface SetUiModeOpts {
|
|
@@ -1134,17 +1146,137 @@ export interface GetUiModeOpts {
|
|
|
1134
1146
|
export interface SmsListResultItem {
|
|
1135
1147
|
id: string;
|
|
1136
1148
|
address: string;
|
|
1137
|
-
person: string|null;
|
|
1149
|
+
person: string | null;
|
|
1138
1150
|
date: string;
|
|
1139
1151
|
read: string;
|
|
1140
1152
|
status: string;
|
|
1141
1153
|
type: string;
|
|
1142
|
-
subject: string|null;
|
|
1154
|
+
subject: string | null;
|
|
1143
1155
|
body: string;
|
|
1144
|
-
serviceCenter: string|null;
|
|
1156
|
+
serviceCenter: string | null;
|
|
1145
1157
|
}
|
|
1146
1158
|
|
|
1147
1159
|
export interface SmsListResult {
|
|
1148
1160
|
items: SmsListResultItem[];
|
|
1149
1161
|
total: number;
|
|
1150
1162
|
}
|
|
1163
|
+
|
|
1164
|
+
export interface GetWebviewsOpts {
|
|
1165
|
+
/**
|
|
1166
|
+
* device socket name
|
|
1167
|
+
*/
|
|
1168
|
+
androidDeviceSocket?: string | null;
|
|
1169
|
+
/**
|
|
1170
|
+
* whether to check for webview page presence
|
|
1171
|
+
*/
|
|
1172
|
+
ensureWebviewsHavePages?: boolean | null;
|
|
1173
|
+
/**
|
|
1174
|
+
* port to use for webview page presence check.
|
|
1175
|
+
*/
|
|
1176
|
+
webviewDevtoolsPort?: number | null;
|
|
1177
|
+
/**
|
|
1178
|
+
* whether to collect web view details and send them to Chromedriver constructor, so it could select a binary more precisely based on this info.
|
|
1179
|
+
*/
|
|
1180
|
+
enableWebviewDetailsCollection?: boolean | null;
|
|
1181
|
+
/**
|
|
1182
|
+
* @privateRemarks This is referenced but was not previously declared
|
|
1183
|
+
*/
|
|
1184
|
+
isChromeSession?: boolean;
|
|
1185
|
+
|
|
1186
|
+
waitForWebviewMs?: number | string;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
export interface ProcessInfo {
|
|
1190
|
+
/**
|
|
1191
|
+
* The process name
|
|
1192
|
+
*/
|
|
1193
|
+
name: string;
|
|
1194
|
+
/**
|
|
1195
|
+
* The process id (if could be retrieved)
|
|
1196
|
+
*/
|
|
1197
|
+
id?: string | null;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
export interface WebViewDetails {
|
|
1201
|
+
/**
|
|
1202
|
+
* Web view process details
|
|
1203
|
+
*/
|
|
1204
|
+
process?: ProcessInfo | null;
|
|
1205
|
+
/**
|
|
1206
|
+
* Web view details as returned by /json/version CDP endpoint
|
|
1207
|
+
* @example
|
|
1208
|
+
* {
|
|
1209
|
+
* "Browser": "Chrome/72.0.3601.0",
|
|
1210
|
+
* "Protocol-Version": "1.3",
|
|
1211
|
+
* "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3601.0 Safari/537.36",
|
|
1212
|
+
* "V8-Version": "7.2.233",
|
|
1213
|
+
* "WebKit-Version": "537.36 (@cfede9db1d154de0468cb0538479f34c0755a0f4)",
|
|
1214
|
+
* "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser/b0b8a4fb-bb17-4359-9533-a8d9f3908bd8"
|
|
1215
|
+
* }
|
|
1216
|
+
*/
|
|
1217
|
+
info?: StringRecord;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
export interface DetailCollectionOptions {
|
|
1221
|
+
/**
|
|
1222
|
+
* The starting port to use for webview page presence check (if not the default of 9222).
|
|
1223
|
+
*/
|
|
1224
|
+
webviewDevtoolsPort?: number | null;
|
|
1225
|
+
/**
|
|
1226
|
+
* Whether to check for webview pages presence
|
|
1227
|
+
*/
|
|
1228
|
+
ensureWebviewsHavePages?: boolean | null;
|
|
1229
|
+
/**
|
|
1230
|
+
* Whether to collect web view details and send them to Chromedriver constructor, so it could
|
|
1231
|
+
* select a binary more precisely based on this info.
|
|
1232
|
+
*/
|
|
1233
|
+
enableWebviewDetailsCollection?: boolean | null;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
export interface WebviewProps {
|
|
1237
|
+
/**
|
|
1238
|
+
* The name of the Devtools Unix socket
|
|
1239
|
+
*/
|
|
1240
|
+
proc: string;
|
|
1241
|
+
/**
|
|
1242
|
+
* The web view alias. Looks like `WEBVIEW_` prefix plus PID or package name
|
|
1243
|
+
*/
|
|
1244
|
+
webview: string;
|
|
1245
|
+
/**
|
|
1246
|
+
* Webview information as it is retrieved by /json/version CDP endpoint
|
|
1247
|
+
*/
|
|
1248
|
+
info?: object | null;
|
|
1249
|
+
/**
|
|
1250
|
+
* Webview pages list as it is retrieved by /json/list CDP endpoint
|
|
1251
|
+
*/
|
|
1252
|
+
pages?: object[] | null;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
export interface WebviewProc {
|
|
1256
|
+
/**
|
|
1257
|
+
* The webview process name (as returned by getPotentialWebviewProcs)
|
|
1258
|
+
*/
|
|
1259
|
+
proc: string;
|
|
1260
|
+
/**
|
|
1261
|
+
* The actual webview context name
|
|
1262
|
+
*/
|
|
1263
|
+
webview: string;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
export interface FastUnlockOptions {
|
|
1267
|
+
credential: string;
|
|
1268
|
+
/**
|
|
1269
|
+
* @privateRemarks FIXME: narrow this type to whatever `appium-adb` expects
|
|
1270
|
+
*/
|
|
1271
|
+
credentialType: string;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
export interface ADBDeviceInfo {
|
|
1275
|
+
udid: string;
|
|
1276
|
+
emPort: number | false;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
export type ADBLaunchInfo = Pick<
|
|
1280
|
+
AndroidDriverCaps,
|
|
1281
|
+
'appPackage' | 'appWaitActivity' | 'appActivity' | 'appWaitPackage'
|
|
1282
|
+
>;
|
package/lib/doctor/checks.js
CHANGED
|
@@ -4,14 +4,16 @@ import path from 'path';
|
|
|
4
4
|
import '@colors/colors';
|
|
5
5
|
import {getAndroidBinaryPath, getSdkRootFromEnv} from 'appium-adb';
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
const JAVA_HOME_VAR_NAME = system.isWindows() ? '%JAVA_HOME%' : '$JAVA_HOME';
|
|
9
|
-
const ENVIRONMENT_VARS_TUTORIAL_URL =
|
|
10
|
-
|
|
8
|
+
const ENVIRONMENT_VARS_TUTORIAL_URL =
|
|
9
|
+
'https://github.com/appium/java-client/blob/master/docs/environment.md';
|
|
10
|
+
const JAVA_HOME_TUTORIAL =
|
|
11
|
+
'https://docs.oracle.com/cd/E21454_01/html/821-2531/inst_jdk_javahome_t.html';
|
|
11
12
|
const ANDROID_SDK_LINK1 = 'https://developer.android.com/studio#cmdline-tools';
|
|
12
13
|
const ANDROID_SDK_LINK2 = 'https://developer.android.com/studio/intro/update#sdk-manager';
|
|
13
14
|
const BUNDLETOOL_RELEASES_LINK = 'https://github.com/google/bundletool/releases/';
|
|
14
|
-
const GSTREAMER_INSTALL_LINK =
|
|
15
|
+
const GSTREAMER_INSTALL_LINK =
|
|
16
|
+
'https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c';
|
|
15
17
|
const FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -39,7 +41,7 @@ class EnvVarAndPathCheck {
|
|
|
39
41
|
return doctor.nok(`${this.varName} environment variable is NOT set!`);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
if (!await fs.exists(varValue)) {
|
|
44
|
+
if (!(await fs.exists(varValue))) {
|
|
43
45
|
let errMsg = `${this.varName} is set to '${varValue}' but this path does not exist!`;
|
|
44
46
|
if (system.isWindows() && varValue.includes('%')) {
|
|
45
47
|
errMsg += ` Consider replacing all references to other environment variables with absolute paths.`;
|
|
@@ -49,10 +51,14 @@ class EnvVarAndPathCheck {
|
|
|
49
51
|
|
|
50
52
|
const stat = await fs.stat(varValue);
|
|
51
53
|
if (this.opts.expectDir && !stat.isDirectory()) {
|
|
52
|
-
return doctor.nok(
|
|
54
|
+
return doctor.nok(
|
|
55
|
+
`${this.varName} is expected to be a valid folder, got a file path instead`,
|
|
56
|
+
);
|
|
53
57
|
}
|
|
54
58
|
if (this.opts.expectFile && stat.isDirectory()) {
|
|
55
|
-
return doctor.nok(
|
|
59
|
+
return doctor.nok(
|
|
60
|
+
`${this.varName} is expected to be a valid file, got a folder path instead`,
|
|
61
|
+
);
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
return doctor.ok(`${this.varName} is set to: ${varValue}`);
|
|
@@ -86,18 +92,20 @@ export class JavaHomeValueCheck {
|
|
|
86
92
|
|
|
87
93
|
const javaBinaryRelativePath = path.join('bin', `java${system.isWindows() ? '.exe' : ''}`);
|
|
88
94
|
const javaBinary = path.join(envVar, javaBinaryRelativePath);
|
|
89
|
-
if (!await fs.exists(javaBinary)) {
|
|
95
|
+
if (!(await fs.exists(javaBinary))) {
|
|
90
96
|
return doctor.nok(
|
|
91
97
|
`${JAVA_HOME_VAR_NAME} is set to an invalid value. ` +
|
|
92
|
-
|
|
98
|
+
`It must be pointing to a folder containing ${javaBinaryRelativePath}`,
|
|
93
99
|
);
|
|
94
100
|
}
|
|
95
101
|
return doctor.ok(`'${javaBinaryRelativePath}' exists under '${envVar}'`);
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
async fix() {
|
|
99
|
-
return
|
|
100
|
-
`
|
|
105
|
+
return (
|
|
106
|
+
`Set ${JAVA_HOME_VAR_NAME} environment variable to the root folder path of your local JDK installation. ` +
|
|
107
|
+
`Read ${JAVA_HOME_TUTORIAL}`
|
|
108
|
+
);
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
hasAutofix() {
|
|
@@ -121,9 +129,7 @@ export class AndroidSdkCheck {
|
|
|
121
129
|
const listOfTools = this.TOOL_NAMES.join(', ');
|
|
122
130
|
const sdkRoot = getSdkRootFromEnv();
|
|
123
131
|
if (!sdkRoot) {
|
|
124
|
-
return doctor.nok(
|
|
125
|
-
`${listOfTools} could not be found because ANDROID_HOME is NOT set!`
|
|
126
|
-
);
|
|
132
|
+
return doctor.nok(`${listOfTools} could not be found because ANDROID_HOME is NOT set!`);
|
|
127
133
|
}
|
|
128
134
|
|
|
129
135
|
this.log.info(` Checking ${listOfTools}`);
|
|
@@ -199,9 +205,11 @@ export class OptionalGstreamerCheck {
|
|
|
199
205
|
|
|
200
206
|
return gstreamerPath && gstInspectPath
|
|
201
207
|
? doctor.okOptional(
|
|
202
|
-
`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY} are installed at: ${gstreamerPath} and ${gstInspectPath}
|
|
208
|
+
`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY} are installed at: ${gstreamerPath} and ${gstInspectPath}`,
|
|
203
209
|
)
|
|
204
|
-
: doctor.nokOptional(
|
|
210
|
+
: doctor.nokOptional(
|
|
211
|
+
`${this.GSTREAMER_BINARY} and/or ${this.GST_INSPECT_BINARY} cannot be found`,
|
|
212
|
+
);
|
|
205
213
|
}
|
|
206
214
|
|
|
207
215
|
async fix() {
|