appium-android-driver 12.4.7 → 12.4.9

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/file-actions.d.ts +37 -19
  3. package/build/lib/commands/file-actions.d.ts.map +1 -1
  4. package/build/lib/commands/file-actions.js +44 -58
  5. package/build/lib/commands/file-actions.js.map +1 -1
  6. package/build/lib/commands/geolocation.d.ts +44 -36
  7. package/build/lib/commands/geolocation.d.ts.map +1 -1
  8. package/build/lib/commands/geolocation.js +38 -32
  9. package/build/lib/commands/geolocation.js.map +1 -1
  10. package/build/lib/commands/intent.d.ts +103 -107
  11. package/build/lib/commands/intent.d.ts.map +1 -1
  12. package/build/lib/commands/intent.js +103 -97
  13. package/build/lib/commands/intent.js.map +1 -1
  14. package/build/lib/commands/log.d.ts +44 -48
  15. package/build/lib/commands/log.d.ts.map +1 -1
  16. package/build/lib/commands/log.js +30 -54
  17. package/build/lib/commands/log.js.map +1 -1
  18. package/build/lib/commands/network.d.ts +59 -39
  19. package/build/lib/commands/network.d.ts.map +1 -1
  20. package/build/lib/commands/network.js +65 -45
  21. package/build/lib/commands/network.js.map +1 -1
  22. package/build/lib/commands/recordscreen.d.ts +25 -40
  23. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  24. package/build/lib/commands/recordscreen.js +46 -63
  25. package/build/lib/commands/recordscreen.js.map +1 -1
  26. package/build/lib/commands/types.d.ts.map +1 -1
  27. package/build/lib/driver.d.ts +11 -10
  28. package/build/lib/driver.d.ts.map +1 -1
  29. package/build/lib/driver.js.map +1 -1
  30. package/lib/commands/{file-actions.js → file-actions.ts} +88 -74
  31. package/lib/commands/{geolocation.js → geolocation.ts} +85 -54
  32. package/lib/commands/intent.ts +422 -0
  33. package/lib/commands/{log.js → log.ts} +68 -73
  34. package/lib/commands/{network.js → network.ts} +106 -59
  35. package/lib/commands/{recordscreen.js → recordscreen.ts} +77 -73
  36. package/lib/commands/types.ts +17 -0
  37. package/lib/driver.ts +2 -1
  38. package/package.json +1 -1
  39. package/lib/commands/intent.js +0 -409
@@ -1,70 +1,90 @@
1
+ import type { AndroidDriver } from '../driver';
2
+ import type { ServiceType, GetConnectivityResult } from './types';
1
3
  /**
2
- * @this {import('../driver').AndroidDriver}
3
- * @returns {Promise<number>}
4
+ * Gets the current network connection state.
5
+ *
6
+ * @returns Promise that resolves to a number representing the network connection state.
7
+ * The value is a bitmask where:
8
+ * - Bit 0 (0b001) = Airplane mode
9
+ * - Bit 1 (0b010) = Wi-Fi
10
+ * - Bit 2 (0b100) = Data connection
4
11
  */
5
- export function getNetworkConnection(this: import("../driver").AndroidDriver): Promise<number>;
12
+ export declare function getNetworkConnection(this: AndroidDriver): Promise<number>;
6
13
  /**
7
- * @this {import('../driver').AndroidDriver}
8
- * @returns {Promise<boolean>}
14
+ * Checks if Wi-Fi is enabled.
15
+ *
16
+ * @returns Promise that resolves to `true` if Wi-Fi is enabled, `false` otherwise.
9
17
  */
10
- export function isWifiOn(this: import("../driver").AndroidDriver): Promise<boolean>;
18
+ export declare function isWifiOn(this: AndroidDriver): Promise<boolean>;
11
19
  /**
20
+ * Sets the connectivity state for Wi-Fi, data, and/or airplane mode.
21
+ *
12
22
  * @since Android 12 (only real devices, emulators work in all APIs)
13
- * @this {import('../driver').AndroidDriver}
14
- * @param {boolean} [wifi] Either to enable or disable Wi-Fi.
23
+ * @param wifi Either to enable or disable Wi-Fi.
15
24
  * An unset value means to not change the state for the given service.
16
- * @param {boolean} [data] Either to enable or disable mobile data connection.
25
+ * @param data Either to enable or disable mobile data connection.
17
26
  * An unset value means to not change the state for the given service.
18
- * @param {boolean} [airplaneMode] Either to enable to disable the Airplane Mode
27
+ * @param airplaneMode Either to enable to disable the Airplane Mode.
19
28
  * An unset value means to not change the state for the given service.
20
- * @returns {Promise<void>}
29
+ * @returns Promise that resolves when the connectivity state is set.
30
+ * @throws {errors.InvalidArgumentError} If none of the options are provided.
21
31
  */
22
- export function mobileSetConnectivity(this: import("../driver").AndroidDriver, wifi?: boolean, data?: boolean, airplaneMode?: boolean): Promise<void>;
32
+ export declare function mobileSetConnectivity(this: AndroidDriver, wifi?: boolean, data?: boolean, airplaneMode?: boolean): Promise<void>;
23
33
  /**
24
- * @this {import('../driver').AndroidDriver}
25
- * @param {import('./types').ServiceType[] | import('./types').ServiceType} [services] one or more
26
- * services to get the connectivity for.
27
- * @returns {Promise<import('./types').GetConnectivityResult>}
34
+ * Gets the connectivity state for one or more services.
35
+ *
36
+ * @param services One or more services to get the connectivity for.
37
+ * @returns Promise that resolves to an object containing the connectivity state for the requested services.
38
+ * @throws {errors.InvalidArgumentError} If any of the provided service names are not supported.
28
39
  */
29
- export function mobileGetConnectivity(this: import("../driver").AndroidDriver, services?: import("./types").ServiceType[] | import("./types").ServiceType): Promise<import("./types").GetConnectivityResult>;
40
+ export declare function mobileGetConnectivity(this: AndroidDriver, services?: ServiceType[] | ServiceType): Promise<GetConnectivityResult>;
30
41
  /**
42
+ * Sets the network connection state using a bitmask.
43
+ *
31
44
  * @since Android 12 (only real devices, emulators work in all APIs)
32
- * @this {import('../driver').AndroidDriver}
33
- * @param {number} type
34
- * @returns {Promise<number>}
45
+ * @param type A number representing the desired network connection state.
46
+ * The value is a bitmask where:
47
+ * - Bit 0 (0b001) = Airplane mode
48
+ * - Bit 1 (0b010) = Wi-Fi
49
+ * - Bit 2 (0b100) = Data connection
50
+ * @returns Promise that resolves to the current network connection state after the change.
35
51
  */
36
- export function setNetworkConnection(this: import("../driver").AndroidDriver, type: number): Promise<number>;
52
+ export declare function setNetworkConnection(this: AndroidDriver, type: number): Promise<number>;
37
53
  /**
54
+ * Sets the Wi-Fi state.
55
+ *
38
56
  * @since Android 12 (only real devices, emulators work in all APIs)
39
- * @this {import('../driver').AndroidDriver}
40
- * @param {boolean} isOn
41
- * @returns {Promise<void>}
57
+ * @param isOn `true` to enable Wi-Fi, `false` to disable it.
58
+ * @returns Promise that resolves when the Wi-Fi state is set.
42
59
  */
43
- export function setWifiState(this: import("../driver").AndroidDriver, isOn: boolean): Promise<void>;
60
+ export declare function setWifiState(this: AndroidDriver, isOn: boolean): Promise<void>;
44
61
  /**
62
+ * Sets the mobile data connection state.
63
+ *
45
64
  * @since Android 12 (only real devices, emulators work in all APIs)
46
- * @this {import('../driver').AndroidDriver}
47
- * @param {boolean} isOn
48
- * @returns {Promise<void>}
65
+ * @param isOn `true` to enable mobile data, `false` to disable it.
66
+ * @returns Promise that resolves when the data connection state is set.
49
67
  */
50
- export function setDataState(this: import("../driver").AndroidDriver, isOn: boolean): Promise<void>;
68
+ export declare function setDataState(this: AndroidDriver, isOn: boolean): Promise<void>;
51
69
  /**
70
+ * Toggles the mobile data connection state.
71
+ *
52
72
  * @since Android 12 (only real devices, emulators work in all APIs)
53
- * @this {import('../driver').AndroidDriver}
54
- * @returns {Promise<void>}
73
+ * @returns Promise that resolves when the data connection state is toggled.
55
74
  */
56
- export function toggleData(this: import("../driver").AndroidDriver): Promise<void>;
75
+ export declare function toggleData(this: AndroidDriver): Promise<void>;
57
76
  /**
77
+ * Toggles the Wi-Fi state.
78
+ *
58
79
  * @since Android 12 (only real devices, emulators work in all APIs)
59
- * @this {import('../driver').AndroidDriver}
60
- * @returns {Promise<void>}
80
+ * @returns Promise that resolves when the Wi-Fi state is toggled.
61
81
  */
62
- export function toggleWiFi(this: import("../driver").AndroidDriver): Promise<void>;
82
+ export declare function toggleWiFi(this: AndroidDriver): Promise<void>;
63
83
  /**
84
+ * Toggles the airplane mode state.
85
+ *
64
86
  * @since Android 12 (only real devices, emulators work in all APIs)
65
- * @this {import('../driver').AndroidDriver}
66
- * @returns {Promise<void>}
87
+ * @returns Promise that resolves when the airplane mode state is toggled.
67
88
  */
68
- export function toggleFlightMode(this: import("../driver").AndroidDriver): Promise<void>;
69
- export type ADB = import("appium-adb").ADB;
89
+ export declare function toggleFlightMode(this: AndroidDriver): Promise<void>;
70
90
  //# sourceMappingURL=network.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../lib/commands/network.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,+EAFa,OAAO,CAAC,MAAM,CAAC,CAgB3B;AAED;;;GAGG;AACH,mEAFa,OAAO,CAAC,OAAO,CAAC,CAI5B;AAED;;;;;;;;;;GAUG;AACH,sFARW,OAAO,SAEP,OAAO,iBAEP,OAAO,GAEL,OAAO,CAAC,IAAI,CAAC,CAmCzB;AAED;;;;;GAKG;AACH,0FAJW,OAAO,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,SAAS,EAAE,WAAW,GAE7D,OAAO,CAAC,OAAO,SAAS,EAAE,qBAAqB,CAAC,CAgC5D;AAED;;;;;GAKG;AACH,oFAHW,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CA0D3B;AAED;;;;;GAKG;AACH,4EAHW,OAAO,GACL,OAAO,CAAC,IAAI,CAAC,CAIzB;AAED;;;;;GAKG;AACH,4EAHW,OAAO,GACL,OAAO,CAAC,IAAI,CAAC,CAIzB;AAED;;;;GAIG;AACH,qEAFa,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;;GAIG;AACH,qEAFa,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;;GAIG;AACH,2EAFa,OAAO,CAAC,IAAI,CAAC,CASzB;kBAGY,OAAO,YAAY,EAAE,GAAG"}
1
+ {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../lib/commands/network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAchE;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,aAAa,EACnB,IAAI,CAAC,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,IAAI,CAAC,CAoCf;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,aAAa,EACnB,QAAQ,GAAE,WAAW,EAAE,GAAG,WAAqC,GAC9D,OAAO,CAAC,qBAAqB,CAAC,CA8BhC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAwDjB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -15,7 +15,7 @@ exports.toggleWiFi = toggleWiFi;
15
15
  exports.toggleFlightMode = toggleFlightMode;
16
16
  const lodash_1 = __importDefault(require("lodash"));
17
17
  const driver_1 = require("appium/driver");
18
- const support_1 = require("appium/support");
18
+ const support_1 = require("@appium/support");
19
19
  const bluebird_1 = __importDefault(require("bluebird"));
20
20
  const AIRPLANE_MODE_MASK = 0b001;
21
21
  const WIFI_MASK = 0b010;
@@ -23,57 +23,69 @@ const DATA_MASK = 0b100;
23
23
  const WIFI_KEY_NAME = 'wifi';
24
24
  const DATA_KEY_NAME = 'data';
25
25
  const AIRPLANE_MODE_KEY_NAME = 'airplaneMode';
26
- const SUPPORTED_SERVICE_NAMES = /** @type {import('./types').ServiceType[]} */ ([
26
+ const SUPPORTED_SERVICE_NAMES = [
27
27
  WIFI_KEY_NAME,
28
28
  DATA_KEY_NAME,
29
29
  AIRPLANE_MODE_KEY_NAME,
30
- ]);
30
+ ];
31
31
  /**
32
- * @this {import('../driver').AndroidDriver}
33
- * @returns {Promise<number>}
32
+ * Gets the current network connection state.
33
+ *
34
+ * @returns Promise that resolves to a number representing the network connection state.
35
+ * The value is a bitmask where:
36
+ * - Bit 0 (0b001) = Airplane mode
37
+ * - Bit 1 (0b010) = Wi-Fi
38
+ * - Bit 2 (0b100) = Data connection
34
39
  */
35
40
  async function getNetworkConnection() {
36
41
  this.log.info('Getting network connection');
37
- let airplaneModeOn = await this.adb.isAirplaneModeOn();
42
+ const airplaneModeOn = await this.adb.isAirplaneModeOn();
38
43
  let connection = airplaneModeOn ? AIRPLANE_MODE_MASK : 0;
39
44
  // no need to check anything else if we are in airplane mode
40
45
  if (!airplaneModeOn) {
41
- let wifiOn = await this.isWifiOn();
46
+ const wifiOn = await this.isWifiOn();
42
47
  connection |= wifiOn ? WIFI_MASK : 0;
43
- let dataOn = await this.adb.isDataOn();
48
+ const dataOn = await this.adb.isDataOn();
44
49
  connection |= dataOn ? DATA_MASK : 0;
45
50
  }
46
51
  return connection;
47
52
  }
48
53
  /**
49
- * @this {import('../driver').AndroidDriver}
50
- * @returns {Promise<boolean>}
54
+ * Checks if Wi-Fi is enabled.
55
+ *
56
+ * @returns Promise that resolves to `true` if Wi-Fi is enabled, `false` otherwise.
51
57
  */
52
58
  async function isWifiOn() {
53
59
  return await this.adb.isWifiOn();
54
60
  }
55
61
  /**
62
+ * Sets the connectivity state for Wi-Fi, data, and/or airplane mode.
63
+ *
56
64
  * @since Android 12 (only real devices, emulators work in all APIs)
57
- * @this {import('../driver').AndroidDriver}
58
- * @param {boolean} [wifi] Either to enable or disable Wi-Fi.
65
+ * @param wifi Either to enable or disable Wi-Fi.
59
66
  * An unset value means to not change the state for the given service.
60
- * @param {boolean} [data] Either to enable or disable mobile data connection.
67
+ * @param data Either to enable or disable mobile data connection.
61
68
  * An unset value means to not change the state for the given service.
62
- * @param {boolean} [airplaneMode] Either to enable to disable the Airplane Mode
69
+ * @param airplaneMode Either to enable to disable the Airplane Mode.
63
70
  * An unset value means to not change the state for the given service.
64
- * @returns {Promise<void>}
71
+ * @returns Promise that resolves when the connectivity state is set.
72
+ * @throws {errors.InvalidArgumentError} If none of the options are provided.
65
73
  */
66
74
  async function mobileSetConnectivity(wifi, data, airplaneMode) {
67
75
  if (lodash_1.default.every([wifi, data, airplaneMode], lodash_1.default.isUndefined)) {
68
76
  throw new driver_1.errors.InvalidArgumentError(`Either one of ${JSON.stringify(SUPPORTED_SERVICE_NAMES)} options must be provided`);
69
77
  }
70
- const currentState = await this.mobileGetConnectivity(
71
- /** @type {import('./types').ServiceType[]} */ ([
72
- ...(lodash_1.default.isUndefined(wifi) ? [] : [WIFI_KEY_NAME]),
73
- ...(lodash_1.default.isUndefined(data) ? [] : [DATA_KEY_NAME]),
74
- ...(lodash_1.default.isUndefined(airplaneMode) ? [] : [AIRPLANE_MODE_KEY_NAME]),
75
- ]));
76
- /** @type {(Promise<any>|(() => Promise<any>))[]} */
78
+ const services = [
79
+ [wifi, WIFI_KEY_NAME],
80
+ [data, DATA_KEY_NAME],
81
+ [airplaneMode, AIRPLANE_MODE_KEY_NAME],
82
+ ].reduce((acc, [value, key]) => {
83
+ if (!lodash_1.default.isUndefined(value)) {
84
+ acc.push(key);
85
+ }
86
+ return acc;
87
+ }, []);
88
+ const currentState = await this.mobileGetConnectivity(services);
77
89
  const setters = [];
78
90
  if (!lodash_1.default.isUndefined(wifi) && currentState.wifi !== Boolean(wifi)) {
79
91
  setters.push(this.setWifiState(wifi));
@@ -94,10 +106,11 @@ async function mobileSetConnectivity(wifi, data, airplaneMode) {
94
106
  }
95
107
  }
96
108
  /**
97
- * @this {import('../driver').AndroidDriver}
98
- * @param {import('./types').ServiceType[] | import('./types').ServiceType} [services] one or more
99
- * services to get the connectivity for.
100
- * @returns {Promise<import('./types').GetConnectivityResult>}
109
+ * Gets the connectivity state for one or more services.
110
+ *
111
+ * @param services One or more services to get the connectivity for.
112
+ * @returns Promise that resolves to an object containing the connectivity state for the requested services.
113
+ * @throws {errors.InvalidArgumentError} If any of the provided service names are not supported.
101
114
  */
102
115
  async function mobileGetConnectivity(services = SUPPORTED_SERVICE_NAMES) {
103
116
  const svcs = lodash_1.default.castArray(services);
@@ -116,10 +129,15 @@ async function mobileGetConnectivity(services = SUPPORTED_SERVICE_NAMES) {
116
129
  return lodash_1.default.reduce(statePromises, (state, v, k) => lodash_1.default.isUndefined(v.value()) ? state : { ...state, [k]: Boolean(v.value()) }, {});
117
130
  }
118
131
  /**
132
+ * Sets the network connection state using a bitmask.
133
+ *
119
134
  * @since Android 12 (only real devices, emulators work in all APIs)
120
- * @this {import('../driver').AndroidDriver}
121
- * @param {number} type
122
- * @returns {Promise<number>}
135
+ * @param type A number representing the desired network connection state.
136
+ * The value is a bitmask where:
137
+ * - Bit 0 (0b001) = Airplane mode
138
+ * - Bit 1 (0b010) = Wi-Fi
139
+ * - Bit 2 (0b100) = Data connection
140
+ * @returns Promise that resolves to the current network connection state after the change.
123
141
  */
124
142
  async function setNetworkConnection(type) {
125
143
  this.log.info('Setting network connection');
@@ -167,27 +185,30 @@ async function setNetworkConnection(type) {
167
185
  return await this.getNetworkConnection();
168
186
  }
169
187
  /**
188
+ * Sets the Wi-Fi state.
189
+ *
170
190
  * @since Android 12 (only real devices, emulators work in all APIs)
171
- * @this {import('../driver').AndroidDriver}
172
- * @param {boolean} isOn
173
- * @returns {Promise<void>}
191
+ * @param isOn `true` to enable Wi-Fi, `false` to disable it.
192
+ * @returns Promise that resolves when the Wi-Fi state is set.
174
193
  */
175
194
  async function setWifiState(isOn) {
176
195
  await this.settingsApp.setWifiState(isOn, this.isEmulator());
177
196
  }
178
197
  /**
198
+ * Sets the mobile data connection state.
199
+ *
179
200
  * @since Android 12 (only real devices, emulators work in all APIs)
180
- * @this {import('../driver').AndroidDriver}
181
- * @param {boolean} isOn
182
- * @returns {Promise<void>}
201
+ * @param isOn `true` to enable mobile data, `false` to disable it.
202
+ * @returns Promise that resolves when the data connection state is set.
183
203
  */
184
204
  async function setDataState(isOn) {
185
205
  await this.settingsApp.setDataState(isOn, this.isEmulator());
186
206
  }
187
207
  /**
208
+ * Toggles the mobile data connection state.
209
+ *
188
210
  * @since Android 12 (only real devices, emulators work in all APIs)
189
- * @this {import('../driver').AndroidDriver}
190
- * @returns {Promise<void>}
211
+ * @returns Promise that resolves when the data connection state is toggled.
191
212
  */
192
213
  async function toggleData() {
193
214
  const isOn = await this.adb.isDataOn();
@@ -195,9 +216,10 @@ async function toggleData() {
195
216
  await this.setDataState(!isOn);
196
217
  }
197
218
  /**
219
+ * Toggles the Wi-Fi state.
220
+ *
198
221
  * @since Android 12 (only real devices, emulators work in all APIs)
199
- * @this {import('../driver').AndroidDriver}
200
- * @returns {Promise<void>}
222
+ * @returns Promise that resolves when the Wi-Fi state is toggled.
201
223
  */
202
224
  async function toggleWiFi() {
203
225
  const isOn = await this.adb.isWifiOn();
@@ -205,19 +227,17 @@ async function toggleWiFi() {
205
227
  await this.setWifiState(!isOn);
206
228
  }
207
229
  /**
230
+ * Toggles the airplane mode state.
231
+ *
208
232
  * @since Android 12 (only real devices, emulators work in all APIs)
209
- * @this {import('../driver').AndroidDriver}
210
- * @returns {Promise<void>}
233
+ * @returns Promise that resolves when the airplane mode state is toggled.
211
234
  */
212
235
  async function toggleFlightMode() {
213
- let flightMode = !(await this.adb.isAirplaneModeOn());
236
+ const flightMode = !(await this.adb.isAirplaneModeOn());
214
237
  this.log.info(`Turning flight mode ${flightMode ? 'on' : 'off'}`);
215
238
  await this.adb.setAirplaneMode(flightMode);
216
239
  if ((await this.adb.getApiLevel()) < 30) {
217
240
  await this.adb.broadcastAirplaneMode(flightMode);
218
241
  }
219
242
  }
220
- /**
221
- * @typedef {import('appium-adb').ADB} ADB
222
- */
223
243
  //# sourceMappingURL=network.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"network.js","sourceRoot":"","sources":["../../../lib/commands/network.js"],"names":[],"mappings":";;;;;AAqBA,oDAcC;AAMD,4BAEC;AAaD,sDAiCC;AAQD,sDA8BC;AAQD,oDAwDC;AAQD,oCAEC;AAQD,oCAEC;AAOD,gCAIC;AAOD,gCAIC;AAOD,4CAOC;AAvPD,oDAAuB;AACvB,0CAAqC;AACrC,4CAAoC;AACpC,wDAAyB;AAEzB,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAC9C,MAAM,uBAAuB,GAAG,8CAA8C,CAAC,CAAC;IAC9E,aAAa;IACb,aAAa;IACb,sBAAsB;CACvB,CAAC,CAAC;AAEH;;;GAGG;AACI,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC5C,IAAI,cAAc,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzD,4DAA4D;IAC5D,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,IAAI,MAA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CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IAC9D,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,UAAU;IAG9B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB;IAGpC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACxD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IAClE,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;QACxC,MAAM,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
@@ -1,47 +1,32 @@
1
+ import type { AndroidDriver } from '../driver';
2
+ import type { StartScreenRecordingOpts, StopScreenRecordingOpts } from './types';
1
3
  /**
4
+ * Starts screen recording on the Android device.
2
5
  *
3
- * @this {import('../driver').AndroidDriver}
4
- * @param {import('./types').StartScreenRecordingOpts} [options={}]
5
- * @returns {Promise<string>}
6
+ * This method uses Android's `screenrecord` command to capture the screen.
7
+ * The recording can be configured with various options such as video size,
8
+ * bit rate, time limit, and more.
9
+ *
10
+ * @param options Recording options. See {@link StartScreenRecordingOpts} for details.
11
+ * @returns Promise that resolves to the result of stopping any previous recording,
12
+ * or an empty string if no previous recording was active.
13
+ * @throws {Error} If screen recording is not supported on the device or emulator,
14
+ * or if the time limit is invalid.
6
15
  */
7
- export function startRecordingScreen(this: import("../driver").AndroidDriver, options?: import("./types").StartScreenRecordingOpts): Promise<string>;
8
- export class startRecordingScreen {
9
- /**
10
- *
11
- * @this {import('../driver').AndroidDriver}
12
- * @param {import('./types').StartScreenRecordingOpts} [options={}]
13
- * @returns {Promise<string>}
14
- */
15
- constructor(this: import("../driver").AndroidDriver, options?: import("./types").StartScreenRecordingOpts);
16
- _screenRecordingProperties: {
17
- timer: timing.Timer;
18
- videoSize: string | undefined;
19
- timeLimit: string | number;
20
- currentTimeLimit: string | number;
21
- bitRate: string | number | undefined;
22
- bugReport: boolean | undefined;
23
- records: never[];
24
- recordingProcess: null;
25
- stopped: boolean;
26
- };
27
- }
16
+ export declare function startRecordingScreen(this: AndroidDriver, options?: StartScreenRecordingOpts): Promise<string>;
28
17
  /**
18
+ * Stops screen recording and returns the recorded video.
19
+ *
20
+ * This method stops any active screen recording session and returns the recorded
21
+ * video as a base64-encoded string or uploads it to a remote location if specified.
22
+ * If multiple recording chunks were created (for long recordings), they will be
23
+ * merged using ffmpeg if available.
29
24
  *
30
- * @this {import('../driver').AndroidDriver}
31
- * @param {import('./types').StopScreenRecordingOpts} [options={}]
32
- * @returns {Promise<string>}
25
+ * @param options Stop recording options. See {@link StopScreenRecordingOpts} for details.
26
+ * @returns Promise that resolves to the recorded video as a base64-encoded string
27
+ * if `remotePath` is not provided, or an empty string if the video was uploaded to a remote location.
28
+ * @throws {Error} If screen recording is not supported, no recording was active,
29
+ * or if the recording process cannot be stopped.
33
30
  */
34
- export function stopRecordingScreen(this: import("../driver").AndroidDriver, options?: import("./types").StopScreenRecordingOpts): Promise<string>;
35
- export class stopRecordingScreen {
36
- /**
37
- *
38
- * @this {import('../driver').AndroidDriver}
39
- * @param {import('./types').StopScreenRecordingOpts} [options={}]
40
- * @returns {Promise<string>}
41
- */
42
- constructor(this: import("../driver").AndroidDriver, options?: import("./types").StopScreenRecordingOpts);
43
- _screenRecordingProperties: any;
44
- }
45
- export type ADB = import("appium-adb").ADB;
46
- import { timing } from '@appium/support';
31
+ export declare function stopRecordingScreen(this: AndroidDriver, options?: StopScreenRecordingOpts): Promise<string>;
47
32
  //# sourceMappingURL=recordscreen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recordscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/recordscreen.js"],"names":[],"mappings":"AAkBA;;;;;GAKG;AACH,wFAHW,OAAO,SAAS,EAAE,wBAAwB,GACxC,OAAO,CAAC,MAAM,CAAC,CAsD3B;;IA1DD;;;;;OAKG;IACH,+DAHW,OAAO,SAAS,EAAE,wBAAwB,EAuDpD;IAxBG;;;;;;;;;;MAA2C;;AA0B/C;;;;;GAKG;AACH,uFAHW,OAAO,SAAS,EAAE,uBAAuB,GACvC,OAAO,CAAC,MAAM,CAAC,CA8E3B;;IAlFD;;;;;OAKG;IACH,+DAHW,OAAO,SAAS,EAAE,uBAAuB,EA+EnD;IAFG,gCAA2C;;kBAuLlC,OAAO,YAAY,EAAE,GAAG;uBArVgB,iBAAiB"}
1
+ {"version":3,"file":"recordscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/recordscreen.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAE7C,OAAO,KAAK,EAAC,wBAAwB,EAAE,uBAAuB,EAA4B,MAAM,SAAS,CAAC;AAc1G;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAsDjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,CA6EjB"}