appium-android-driver 12.5.0 → 12.6.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 +6 -0
- package/build/lib/commands/device/common.d.ts +17 -13
- package/build/lib/commands/device/common.d.ts.map +1 -1
- package/build/lib/commands/device/common.js +25 -25
- package/build/lib/commands/device/common.js.map +1 -1
- package/build/lib/commands/device/emulator-actions.d.ts +50 -74
- package/build/lib/commands/device/emulator-actions.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-actions.js +35 -63
- package/build/lib/commands/device/emulator-actions.js.map +1 -1
- package/build/lib/commands/device/emulator-console.d.ts +12 -10
- package/build/lib/commands/device/emulator-console.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-console.js +11 -10
- package/build/lib/commands/device/emulator-console.js.map +1 -1
- package/build/lib/commands/device/utils.d.ts +31 -28
- package/build/lib/commands/device/utils.d.ts.map +1 -1
- package/build/lib/commands/device/utils.js +32 -26
- package/build/lib/commands/device/utils.js.map +1 -1
- package/lib/commands/device/{common.js → common.ts} +48 -38
- package/lib/commands/device/emulator-actions.ts +222 -0
- package/lib/commands/device/emulator-console.ts +38 -0
- package/lib/commands/device/{utils.js → utils.ts} +45 -37
- package/package.json +1 -1
- package/lib/commands/device/emulator-actions.js +0 -192
- package/lib/commands/device/emulator-console.js +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [12.6.0](https://github.com/appium/appium-android-driver/compare/v12.5.0...v12.6.0) (2025-12-21)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* Migrate device extensions to typescript ([#1044](https://github.com/appium/appium-android-driver/issues/1044)) ([b6b3a3c](https://github.com/appium/appium-android-driver/commit/b6b3a3c731dc243f1cedfaa4f8bd4615240ff9b1))
|
|
6
|
+
|
|
1
7
|
## [12.5.0](https://github.com/appium/appium-android-driver/compare/v12.4.11...v12.5.0) (2025-12-20)
|
|
2
8
|
|
|
3
9
|
### Features
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
import type { AndroidDriver } from '../../driver';
|
|
2
|
+
import type { ADBDeviceInfo, ADBLaunchInfo } from '../types';
|
|
3
|
+
import type { ADB } from 'appium-adb';
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
5
|
+
* Gets device information from capabilities, including UDID and emulator port.
|
|
6
|
+
*
|
|
7
|
+
* @returns Device information with UDID and emulator port
|
|
4
8
|
*/
|
|
5
|
-
export function getDeviceInfoFromCaps(this:
|
|
9
|
+
export declare function getDeviceInfoFromCaps(this: AndroidDriver): Promise<ADBDeviceInfo>;
|
|
6
10
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
11
|
+
* Creates an ADB instance configured with the device UDID and emulator port from options.
|
|
12
|
+
*
|
|
13
|
+
* @returns A configured ADB instance
|
|
9
14
|
*/
|
|
10
|
-
export function createADB(this:
|
|
15
|
+
export declare function createADB(this: AndroidDriver): Promise<ADB>;
|
|
11
16
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
17
|
+
* Gets launch information (package and activity) from the app manifest or options.
|
|
18
|
+
*
|
|
19
|
+
* @returns Launch information with package and activity names, or undefined if not needed
|
|
14
20
|
*/
|
|
15
|
-
export function getLaunchInfo(this:
|
|
21
|
+
export declare function getLaunchInfo(this: AndroidDriver): Promise<ADBLaunchInfo | undefined>;
|
|
16
22
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @returns {Promise<void>}
|
|
23
|
+
* Initializes the device with various settings like locale, keyboard, logcat, etc.
|
|
19
24
|
*/
|
|
20
|
-
export function initDevice(this:
|
|
21
|
-
export type AndroidDriver = import("../../driver").AndroidDriver;
|
|
25
|
+
export declare function initDevice(this: AndroidDriver): Promise<void>;
|
|
22
26
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../lib/commands/device/common.
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../lib/commands/device/common.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAEpC;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CA2GvF;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAQjE;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAyC3F;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAyGnE"}
|
|
@@ -52,8 +52,9 @@ const time_1 = require("../time");
|
|
|
52
52
|
const asyncbox_1 = require("asyncbox");
|
|
53
53
|
const utils_2 = require("../../utils");
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
* Gets device information from capabilities, including UDID and emulator port.
|
|
56
|
+
*
|
|
57
|
+
* @returns Device information with UDID and emulator port
|
|
57
58
|
*/
|
|
58
59
|
async function getDeviceInfoFromCaps() {
|
|
59
60
|
// we can create a throwaway ADB instance here, so there is no dependency
|
|
@@ -93,7 +94,6 @@ async function getDeviceInfoFromCaps() {
|
|
|
93
94
|
for (const device of devices) {
|
|
94
95
|
// direct adb calls to the specific device
|
|
95
96
|
adb.setDeviceId(device.udid);
|
|
96
|
-
/** @type {string} */
|
|
97
97
|
const rawDeviceOS = await adb.getPlatformVersion();
|
|
98
98
|
// The device OS could either be a number, like `6.0`
|
|
99
99
|
// or an abbreviation, like `R`
|
|
@@ -107,8 +107,8 @@ async function getDeviceInfoFromCaps() {
|
|
|
107
107
|
const bothVersionsCanBeCoerced = semver.valid(deviceOS) && semver.valid(platformVersion);
|
|
108
108
|
const bothVersionsAreStrings = lodash_1.default.isString(deviceOS) && lodash_1.default.isString(platformVersion);
|
|
109
109
|
if ((bothVersionsCanBeCoerced &&
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
semverDO.version ===
|
|
111
|
+
semverPV.version) ||
|
|
112
112
|
(bothVersionsAreStrings && lodash_1.default.toLower(deviceOS) === lodash_1.default.toLower(platformVersion))) {
|
|
113
113
|
// Got an exact match - proceed immediately
|
|
114
114
|
udid = device.udid;
|
|
@@ -118,10 +118,10 @@ async function getDeviceInfoFromCaps() {
|
|
|
118
118
|
// There is no point to check for partial match if either of version numbers is not coercible
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
|
-
const pvMajor =
|
|
122
|
-
const pvMinor =
|
|
123
|
-
const dvMajor =
|
|
124
|
-
const dvMinor =
|
|
121
|
+
const pvMajor = semverPV.major;
|
|
122
|
+
const pvMinor = semverPV.minor;
|
|
123
|
+
const dvMajor = semverDO.major;
|
|
124
|
+
const dvMinor = semverDO.minor;
|
|
125
125
|
if (((!lodash_1.default.includes(this.opts.platformVersion, '.') && pvMajor === dvMajor) ||
|
|
126
126
|
(pvMajor === dvMajor && pvMinor === dvMinor)) &&
|
|
127
127
|
// Got a partial match - make sure we consider the most recent
|
|
@@ -153,11 +153,11 @@ async function getDeviceInfoFromCaps() {
|
|
|
153
153
|
return { udid: String(udid), emPort: emPort ?? false };
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
156
|
+
* Creates an ADB instance configured with the device UDID and emulator port from options.
|
|
157
|
+
*
|
|
158
|
+
* @returns A configured ADB instance
|
|
158
159
|
*/
|
|
159
160
|
async function createADB() {
|
|
160
|
-
// @ts-expect-error do not put arbitrary properties on opts
|
|
161
161
|
const { udid, emPort } = this.opts;
|
|
162
162
|
const adb = await utils_1.createBaseADB.bind(this)();
|
|
163
163
|
adb.setDeviceId(udid ?? '');
|
|
@@ -167,19 +167,24 @@ async function createADB() {
|
|
|
167
167
|
return adb;
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
170
|
+
* Gets launch information (package and activity) from the app manifest or options.
|
|
171
|
+
*
|
|
172
|
+
* @returns Launch information with package and activity names, or undefined if not needed
|
|
172
173
|
*/
|
|
173
174
|
async function getLaunchInfo() {
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
const { app: appOpt, appPackage: appPackageOpt, appActivity: appActivityOpt, appWaitPackage: appWaitPackageOpt, appWaitActivity: appWaitActivityOpt } = this.opts;
|
|
176
|
+
let appPackage = appPackageOpt;
|
|
177
|
+
let appActivity = appActivityOpt;
|
|
178
|
+
let appWaitPackage = appWaitPackageOpt;
|
|
179
|
+
let appWaitActivity = appWaitActivityOpt;
|
|
180
|
+
if ((appPackage && appActivity) || (!appOpt && !appPackage)) {
|
|
176
181
|
return;
|
|
177
182
|
}
|
|
178
183
|
let apkPackage;
|
|
179
184
|
let apkActivity;
|
|
180
|
-
if (
|
|
181
|
-
this.log.debug(`Parsing package and activity from the '${node_path_1.default.basename(
|
|
182
|
-
({ apkPackage, apkActivity } = await this.adb.packageAndLaunchActivityFromManifest(
|
|
185
|
+
if (appOpt) {
|
|
186
|
+
this.log.debug(`Parsing package and activity from the '${node_path_1.default.basename(appOpt)}' file manifest`);
|
|
187
|
+
({ apkPackage, apkActivity } = await this.adb.packageAndLaunchActivityFromManifest(appOpt));
|
|
183
188
|
}
|
|
184
189
|
else if (appPackage) {
|
|
185
190
|
this.log.debug(`Parsing activity from the installed '${appPackage}' package manifest`);
|
|
@@ -202,8 +207,7 @@ async function getLaunchInfo() {
|
|
|
202
207
|
return { appPackage, appWaitPackage, appActivity, appWaitActivity };
|
|
203
208
|
}
|
|
204
209
|
/**
|
|
205
|
-
*
|
|
206
|
-
* @returns {Promise<void>}
|
|
210
|
+
* Initializes the device with various settings like locale, keyboard, logcat, etc.
|
|
207
211
|
*/
|
|
208
212
|
async function initDevice() {
|
|
209
213
|
const { skipDeviceInitialization, locale, language, localeScript, unicodeKeyboard, hideKeyboard, disableWindowAnimation, skipUnlock, mockLocationApp, skipLogcatCapture, logcatFormat, logcatFilterSpecs, timeZone, } = this.opts;
|
|
@@ -229,7 +233,6 @@ async function initDevice() {
|
|
|
229
233
|
!skipUnlock);
|
|
230
234
|
await utils_1.pushSettingsApp.bind(this)(shouldThrowError);
|
|
231
235
|
}
|
|
232
|
-
/** @type {Promise[]} */
|
|
233
236
|
const setupPromises = [];
|
|
234
237
|
if (!this.isEmulator()) {
|
|
235
238
|
setupPromises.push((async () => {
|
|
@@ -292,7 +295,4 @@ async function initDevice() {
|
|
|
292
295
|
}
|
|
293
296
|
await bluebird_1.default.all(setupPromises);
|
|
294
297
|
}
|
|
295
|
-
/**
|
|
296
|
-
* @typedef {import('../../driver').AndroidDriver} AndroidDriver
|
|
297
|
-
*/
|
|
298
298
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/commands/device/common.
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/commands/device/common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,sDA2GC;AAOD,8BAQC;AAOD,sCAyCC;AAKD,gCAyGC;AAnTD,+CAAiC;AACjC,oDAAuB;AACvB,wDAAyB;AACzB,0DAA6B;AAC7B,gDAAkD;AAClD,2DAAsD;AACtD,0CAAwE;AACxE,mCAIiB;AACjB,kCAAuC;AACvC,uCAAuC;AACvC,uCAGqB;AAKrB;;;;GAIG;AACI,KAAK,UAAU,qBAAqB;IACzC,yEAAyE;IACzE,+DAA+D;IAC/D,0EAA0E;IAC1E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C;QACpB,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC,GAAG,CAAC,IAAI,CACX,4EAA4E;gBAC1E,gGAAgG,CACnG,CAAC;YACF,MAAM,8BAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,CAAC,CAAC,EAAE,CAAC,CAAC;IACR,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,aAAa,CAAC,IAAI,CAAC,qBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,IAAI,CAAC,gBAAgB,CAAC,+BAAuB,CAAC,EAAE,CAAC;QACnD,CAAC,EAAE,IAAI,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAC1D,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,KAAK;YACnB,gBAAgB,EAAE,qCAA6B;SAChD,CACF,CAAC;IACJ,CAAC;IAED,MAAM,kBAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,121 +1,97 @@
|
|
|
1
|
+
import type { AndroidDriver } from '../../driver';
|
|
2
|
+
import type { GsmAction, GsmSignalStrength, GsmVoiceState, PowerACState, NetworkSpeed } from '../types';
|
|
1
3
|
/**
|
|
2
4
|
* @deprecated Use mobile: extension
|
|
3
|
-
* @this {import('../../driver').AndroidDriver}
|
|
4
|
-
* @param {string|number} fingerprintId
|
|
5
|
-
* @returns {Promise<void>}
|
|
6
5
|
*/
|
|
7
|
-
export function fingerprint(this:
|
|
6
|
+
export declare function fingerprint(this: AndroidDriver, fingerprintId: string | number): Promise<void>;
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Simulates a fingerprint scan on the emulator.
|
|
9
|
+
*
|
|
10
|
+
* @param fingerprintId - The value is the `finger_id` for the finger that was "scanned". It is a
|
|
11
11
|
* unique integer that you assign for each virtual fingerprint. When the app
|
|
12
12
|
* is running you can run this same command each time the emulator prompts you
|
|
13
13
|
* for a fingerprint, you can run the adb command and pass it the `finger_id`
|
|
14
14
|
* to simulate the fingerprint scan.
|
|
15
|
-
* @returns {Promise<void>}
|
|
16
15
|
*/
|
|
17
|
-
export function mobileFingerprint(this:
|
|
16
|
+
export declare function mobileFingerprint(this: AndroidDriver, fingerprintId: string | number): Promise<void>;
|
|
18
17
|
/**
|
|
19
18
|
* @deprecated Use mobile: extension
|
|
20
|
-
* @this {import('../../driver').AndroidDriver}
|
|
21
|
-
* @param {string} phoneNumber
|
|
22
|
-
* @param {string} message
|
|
23
|
-
* @returns {Promise<void>}
|
|
24
19
|
*/
|
|
25
|
-
export function sendSMS(this:
|
|
20
|
+
export declare function sendSMS(this: AndroidDriver, phoneNumber: string, message: string): Promise<void>;
|
|
26
21
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
22
|
+
* Sends an SMS message to the emulator.
|
|
23
|
+
*
|
|
24
|
+
* @param phoneNumber - The phone number to send SMS to
|
|
25
|
+
* @param message - The message payload
|
|
31
26
|
*/
|
|
32
|
-
export function mobileSendSms(this:
|
|
27
|
+
export declare function mobileSendSms(this: AndroidDriver, phoneNumber: string, message: string): Promise<void>;
|
|
33
28
|
/**
|
|
34
29
|
* @deprecated Use mobile: extension
|
|
35
|
-
* @this {import('../../driver').AndroidDriver}
|
|
36
|
-
* @param {string} phoneNumber
|
|
37
|
-
* @param {string} action
|
|
38
|
-
* @returns {Promise<void>}
|
|
39
30
|
*/
|
|
40
|
-
export function gsmCall(this:
|
|
31
|
+
export declare function gsmCall(this: AndroidDriver, phoneNumber: string, action: GsmAction): Promise<void>;
|
|
41
32
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @param
|
|
45
|
-
* @
|
|
33
|
+
* Simulates a GSM call on the emulator.
|
|
34
|
+
*
|
|
35
|
+
* @param phoneNumber - The phone number to call to
|
|
36
|
+
* @param action - Action to take
|
|
46
37
|
*/
|
|
47
|
-
export function mobileGsmCall(this:
|
|
38
|
+
export declare function mobileGsmCall(this: AndroidDriver, phoneNumber: string, action: GsmAction): Promise<void>;
|
|
48
39
|
/**
|
|
49
40
|
* @deprecated Use mobile: extension
|
|
50
|
-
* @this {import('../../driver').AndroidDriver}
|
|
51
|
-
* @param {import('../types').GsmSignalStrength} signalStrengh
|
|
52
|
-
* @returns {Promise<void>}
|
|
53
41
|
*/
|
|
54
|
-
export function gsmSignal(this:
|
|
42
|
+
export declare function gsmSignal(this: AndroidDriver, signalStrength: GsmSignalStrength): Promise<void>;
|
|
55
43
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @
|
|
44
|
+
* Sets the GSM signal strength on the emulator.
|
|
45
|
+
*
|
|
46
|
+
* @param strength - The signal strength value
|
|
59
47
|
*/
|
|
60
|
-
export function mobileGsmSignal(this:
|
|
48
|
+
export declare function mobileGsmSignal(this: AndroidDriver, strength: GsmSignalStrength): Promise<void>;
|
|
61
49
|
/**
|
|
62
50
|
* @deprecated Use mobile: extension
|
|
63
|
-
* @this {import('../../driver').AndroidDriver}
|
|
64
|
-
* @param {import('../types').GsmVoiceState} state
|
|
65
|
-
* @returns {Promise<void>}
|
|
66
51
|
*/
|
|
67
|
-
export function gsmVoice(this:
|
|
52
|
+
export declare function gsmVoice(this: AndroidDriver, state: GsmVoiceState): Promise<void>;
|
|
68
53
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @
|
|
54
|
+
* Sets the GSM voice state on the emulator.
|
|
55
|
+
*
|
|
56
|
+
* @param state - The voice state
|
|
72
57
|
*/
|
|
73
|
-
export function mobileGsmVoice(this:
|
|
58
|
+
export declare function mobileGsmVoice(this: AndroidDriver, state: GsmVoiceState): Promise<void>;
|
|
74
59
|
/**
|
|
75
60
|
* @deprecated Use mobile: extension
|
|
76
|
-
* @this {import('../../driver').AndroidDriver}
|
|
77
|
-
* @param {import('../types').PowerACState} state
|
|
78
|
-
* @returns {Promise<void>}
|
|
79
61
|
*/
|
|
80
|
-
export function powerAC(this:
|
|
62
|
+
export declare function powerAC(this: AndroidDriver, state: PowerACState): Promise<void>;
|
|
81
63
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* @
|
|
64
|
+
* Sets the power AC state on the emulator.
|
|
65
|
+
*
|
|
66
|
+
* @param state - The AC power state
|
|
85
67
|
*/
|
|
86
|
-
export function mobilePowerAc(this:
|
|
68
|
+
export declare function mobilePowerAc(this: AndroidDriver, state: PowerACState): Promise<void>;
|
|
87
69
|
/**
|
|
88
70
|
* @deprecated Use mobile: extension
|
|
89
|
-
* @this {import('../../driver').AndroidDriver}
|
|
90
|
-
* @param {number} batteryPercent
|
|
91
|
-
* @returns {Promise<void>}
|
|
92
71
|
*/
|
|
93
|
-
export function powerCapacity(this:
|
|
72
|
+
export declare function powerCapacity(this: AndroidDriver, batteryPercent: number): Promise<void>;
|
|
94
73
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* @
|
|
74
|
+
* Sets the battery capacity on the emulator.
|
|
75
|
+
*
|
|
76
|
+
* @param percent - Percentage value in range `[0, 100]`
|
|
98
77
|
*/
|
|
99
|
-
export function mobilePowerCapacity(this:
|
|
78
|
+
export declare function mobilePowerCapacity(this: AndroidDriver, percent: number): Promise<void>;
|
|
100
79
|
/**
|
|
101
80
|
* @deprecated Use mobile: extension
|
|
102
|
-
* @this {import('../../driver').AndroidDriver}
|
|
103
|
-
* @param {import('../types').NetworkSpeed} networkSpeed
|
|
104
|
-
* @returns {Promise<void>}
|
|
105
81
|
*/
|
|
106
|
-
export function networkSpeed(this:
|
|
82
|
+
export declare function networkSpeed(this: AndroidDriver, networkSpeed: NetworkSpeed): Promise<void>;
|
|
107
83
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* @
|
|
84
|
+
* Sets the network speed on the emulator.
|
|
85
|
+
*
|
|
86
|
+
* @param speed - The network speed value
|
|
111
87
|
*/
|
|
112
|
-
export function mobileNetworkSpeed(this:
|
|
88
|
+
export declare function mobileNetworkSpeed(this: AndroidDriver, speed: NetworkSpeed): Promise<void>;
|
|
113
89
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @param
|
|
117
|
-
* @
|
|
90
|
+
* Sets a sensor value on the emulator.
|
|
91
|
+
*
|
|
92
|
+
* @param sensorType - Sensor type as declared in `adb.SENSORS`
|
|
93
|
+
* @param value - Value to set to the sensor
|
|
94
|
+
* @throws {errors.InvalidArgumentError} If sensorType or value is not provided
|
|
118
95
|
*/
|
|
119
|
-
export function sensorSet(this:
|
|
120
|
-
export type ADB = import("appium-adb").ADB;
|
|
96
|
+
export declare function sensorSet(this: AndroidDriver, sensorType: string, value: string | number): Promise<void>;
|
|
121
97
|
//# sourceMappingURL=emulator-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emulator-actions.d.ts","sourceRoot":"","sources":["../../../../lib/commands/device/emulator-actions.
|
|
1
|
+
{"version":3,"file":"emulator-actions.d.ts","sourceRoot":"","sources":["../../../../lib/commands/device/emulator-actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtG;;GAEG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,aAAa,EACnB,aAAa,EAAE,MAAM,GAAG,MAAM,GAC7B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,aAAa,EACnB,aAAa,EAAE,MAAM,GAAG,MAAM,GAC7B,OAAO,CA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,aAAa,EACnB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,aAAa,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -22,161 +22,136 @@ const utils_1 = require("./utils");
|
|
|
22
22
|
const driver_1 = require("appium/driver");
|
|
23
23
|
/**
|
|
24
24
|
* @deprecated Use mobile: extension
|
|
25
|
-
* @this {import('../../driver').AndroidDriver}
|
|
26
|
-
* @param {string|number} fingerprintId
|
|
27
|
-
* @returns {Promise<void>}
|
|
28
25
|
*/
|
|
29
26
|
async function fingerprint(fingerprintId) {
|
|
30
27
|
utils_1.requireEmulator.bind(this)('fingerprint is only available for emulators');
|
|
31
28
|
await this.adb.fingerprint(String(fingerprintId));
|
|
32
29
|
}
|
|
33
30
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
31
|
+
* Simulates a fingerprint scan on the emulator.
|
|
32
|
+
*
|
|
33
|
+
* @param fingerprintId - The value is the `finger_id` for the finger that was "scanned". It is a
|
|
36
34
|
* unique integer that you assign for each virtual fingerprint. When the app
|
|
37
35
|
* is running you can run this same command each time the emulator prompts you
|
|
38
36
|
* for a fingerprint, you can run the adb command and pass it the `finger_id`
|
|
39
37
|
* to simulate the fingerprint scan.
|
|
40
|
-
* @returns {Promise<void>}
|
|
41
38
|
*/
|
|
42
39
|
async function mobileFingerprint(fingerprintId) {
|
|
43
40
|
await this.fingerprint(fingerprintId);
|
|
44
41
|
}
|
|
45
42
|
/**
|
|
46
43
|
* @deprecated Use mobile: extension
|
|
47
|
-
* @this {import('../../driver').AndroidDriver}
|
|
48
|
-
* @param {string} phoneNumber
|
|
49
|
-
* @param {string} message
|
|
50
|
-
* @returns {Promise<void>}
|
|
51
44
|
*/
|
|
52
45
|
async function sendSMS(phoneNumber, message) {
|
|
53
46
|
utils_1.requireEmulator.bind(this)('sendSMS is only available for emulators');
|
|
54
47
|
await this.adb.sendSMS(phoneNumber, message);
|
|
55
48
|
}
|
|
56
49
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @param
|
|
60
|
-
* @
|
|
50
|
+
* Sends an SMS message to the emulator.
|
|
51
|
+
*
|
|
52
|
+
* @param phoneNumber - The phone number to send SMS to
|
|
53
|
+
* @param message - The message payload
|
|
61
54
|
*/
|
|
62
55
|
async function mobileSendSms(phoneNumber, message) {
|
|
63
56
|
await this.sendSMS(phoneNumber, message);
|
|
64
57
|
}
|
|
65
58
|
/**
|
|
66
59
|
* @deprecated Use mobile: extension
|
|
67
|
-
* @this {import('../../driver').AndroidDriver}
|
|
68
|
-
* @param {string} phoneNumber
|
|
69
|
-
* @param {string} action
|
|
70
|
-
* @returns {Promise<void>}
|
|
71
60
|
*/
|
|
72
61
|
async function gsmCall(phoneNumber, action) {
|
|
73
62
|
utils_1.requireEmulator.bind(this)('gsmCall is only available for emulators');
|
|
74
|
-
await this.adb.gsmCall(phoneNumber,
|
|
63
|
+
await this.adb.gsmCall(phoneNumber, action);
|
|
75
64
|
}
|
|
76
65
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* @param
|
|
80
|
-
* @
|
|
66
|
+
* Simulates a GSM call on the emulator.
|
|
67
|
+
*
|
|
68
|
+
* @param phoneNumber - The phone number to call to
|
|
69
|
+
* @param action - Action to take
|
|
81
70
|
*/
|
|
82
71
|
async function mobileGsmCall(phoneNumber, action) {
|
|
83
72
|
await this.gsmCall(phoneNumber, action);
|
|
84
73
|
}
|
|
85
74
|
/**
|
|
86
75
|
* @deprecated Use mobile: extension
|
|
87
|
-
* @this {import('../../driver').AndroidDriver}
|
|
88
|
-
* @param {import('../types').GsmSignalStrength} signalStrengh
|
|
89
|
-
* @returns {Promise<void>}
|
|
90
76
|
*/
|
|
91
|
-
async function gsmSignal(
|
|
77
|
+
async function gsmSignal(signalStrength) {
|
|
92
78
|
utils_1.requireEmulator.bind(this)('gsmSignal is only available for emulators');
|
|
93
|
-
await this.adb.gsmSignal(
|
|
79
|
+
await this.adb.gsmSignal(signalStrength);
|
|
94
80
|
}
|
|
95
81
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* @
|
|
82
|
+
* Sets the GSM signal strength on the emulator.
|
|
83
|
+
*
|
|
84
|
+
* @param strength - The signal strength value
|
|
99
85
|
*/
|
|
100
86
|
async function mobileGsmSignal(strength) {
|
|
101
87
|
await this.gsmSignal(strength);
|
|
102
88
|
}
|
|
103
89
|
/**
|
|
104
90
|
* @deprecated Use mobile: extension
|
|
105
|
-
* @this {import('../../driver').AndroidDriver}
|
|
106
|
-
* @param {import('../types').GsmVoiceState} state
|
|
107
|
-
* @returns {Promise<void>}
|
|
108
91
|
*/
|
|
109
92
|
async function gsmVoice(state) {
|
|
110
93
|
utils_1.requireEmulator.bind(this)('gsmVoice is only available for emulators');
|
|
111
94
|
await this.adb.gsmVoice(state);
|
|
112
95
|
}
|
|
113
96
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @
|
|
97
|
+
* Sets the GSM voice state on the emulator.
|
|
98
|
+
*
|
|
99
|
+
* @param state - The voice state
|
|
117
100
|
*/
|
|
118
101
|
async function mobileGsmVoice(state) {
|
|
119
102
|
await this.gsmVoice(state);
|
|
120
103
|
}
|
|
121
104
|
/**
|
|
122
105
|
* @deprecated Use mobile: extension
|
|
123
|
-
* @this {import('../../driver').AndroidDriver}
|
|
124
|
-
* @param {import('../types').PowerACState} state
|
|
125
|
-
* @returns {Promise<void>}
|
|
126
106
|
*/
|
|
127
107
|
async function powerAC(state) {
|
|
128
108
|
utils_1.requireEmulator.bind(this)('powerAC is only available for emulators');
|
|
129
109
|
await this.adb.powerAC(state);
|
|
130
110
|
}
|
|
131
111
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* @
|
|
112
|
+
* Sets the power AC state on the emulator.
|
|
113
|
+
*
|
|
114
|
+
* @param state - The AC power state
|
|
135
115
|
*/
|
|
136
116
|
async function mobilePowerAc(state) {
|
|
137
117
|
await this.powerAC(state);
|
|
138
118
|
}
|
|
139
119
|
/**
|
|
140
120
|
* @deprecated Use mobile: extension
|
|
141
|
-
* @this {import('../../driver').AndroidDriver}
|
|
142
|
-
* @param {number} batteryPercent
|
|
143
|
-
* @returns {Promise<void>}
|
|
144
121
|
*/
|
|
145
122
|
async function powerCapacity(batteryPercent) {
|
|
146
123
|
utils_1.requireEmulator.bind(this)('powerCapacity is only available for emulators');
|
|
147
124
|
await this.adb.powerCapacity(batteryPercent);
|
|
148
125
|
}
|
|
149
126
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @
|
|
127
|
+
* Sets the battery capacity on the emulator.
|
|
128
|
+
*
|
|
129
|
+
* @param percent - Percentage value in range `[0, 100]`
|
|
153
130
|
*/
|
|
154
131
|
async function mobilePowerCapacity(percent) {
|
|
155
132
|
await this.powerCapacity(percent);
|
|
156
133
|
}
|
|
157
134
|
/**
|
|
158
135
|
* @deprecated Use mobile: extension
|
|
159
|
-
* @this {import('../../driver').AndroidDriver}
|
|
160
|
-
* @param {import('../types').NetworkSpeed} networkSpeed
|
|
161
|
-
* @returns {Promise<void>}
|
|
162
136
|
*/
|
|
163
137
|
async function networkSpeed(networkSpeed) {
|
|
164
138
|
utils_1.requireEmulator.bind(this)('networkSpeed is only available for emulators');
|
|
165
139
|
await this.adb.networkSpeed(networkSpeed);
|
|
166
140
|
}
|
|
167
141
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* @
|
|
142
|
+
* Sets the network speed on the emulator.
|
|
143
|
+
*
|
|
144
|
+
* @param speed - The network speed value
|
|
171
145
|
*/
|
|
172
146
|
async function mobileNetworkSpeed(speed) {
|
|
173
147
|
await this.networkSpeed(speed);
|
|
174
148
|
}
|
|
175
149
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* @param
|
|
179
|
-
* @
|
|
150
|
+
* Sets a sensor value on the emulator.
|
|
151
|
+
*
|
|
152
|
+
* @param sensorType - Sensor type as declared in `adb.SENSORS`
|
|
153
|
+
* @param value - Value to set to the sensor
|
|
154
|
+
* @throws {errors.InvalidArgumentError} If sensorType or value is not provided
|
|
180
155
|
*/
|
|
181
156
|
async function sensorSet(sensorType, value) {
|
|
182
157
|
utils_1.requireEmulator.bind(this)('sensorSet is only available for emulators');
|
|
@@ -186,9 +161,6 @@ async function sensorSet(sensorType, value) {
|
|
|
186
161
|
if (!support_1.util.hasValue(value)) {
|
|
187
162
|
throw new driver_1.errors.InvalidArgumentError(`'value' argument is required`);
|
|
188
163
|
}
|
|
189
|
-
await this.adb.sensorSet(sensorType,
|
|
164
|
+
await this.adb.sensorSet(sensorType, value);
|
|
190
165
|
}
|
|
191
|
-
/**
|
|
192
|
-
* @typedef {import('appium-adb').ADB} ADB
|
|
193
|
-
*/
|
|
194
166
|
//# sourceMappingURL=emulator-actions.js.map
|