io.appium.settings 7.0.7 → 7.0.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.
- package/CHANGELOG.md +12 -0
- package/apks/settings_apk-debug.apk +0 -0
- package/build/lib/commands/geolocation.d.ts +12 -69
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +13 -35
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +32 -45
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +51 -57
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/types.d.ts +38 -0
- package/build/lib/commands/types.d.ts.map +1 -0
- package/build/lib/commands/types.js +3 -0
- package/build/lib/commands/types.js.map +1 -0
- package/build/lib/commands/utf7.d.ts +17 -16
- package/build/lib/commands/utf7.d.ts.map +1 -1
- package/build/lib/commands/utf7.js +73 -91
- package/build/lib/commands/utf7.js.map +1 -1
- package/lib/commands/{geolocation.js → geolocation.ts} +25 -46
- package/lib/commands/{media-projection.js → media-projection.ts} +59 -63
- package/lib/commands/types.ts +38 -0
- package/lib/commands/{utf7.js → utf7.ts} +83 -102
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [7.0.9](https://github.com/appium/io.appium.settings/compare/v7.0.8...v7.0.9) (2026-01-10)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate various commands to typescript (part 1) ([#262](https://github.com/appium/io.appium.settings/issues/262)) ([0fbd1f3](https://github.com/appium/io.appium.settings/commit/0fbd1f3404d0614e8671cb4f872113c305223f4e))
|
|
6
|
+
|
|
7
|
+
## [7.0.8](https://github.com/appium/io.appium.settings/compare/v7.0.7...v7.0.8) (2025-12-21)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* bump teen_process ([#261](https://github.com/appium/io.appium.settings/issues/261)) ([0b8c64e](https://github.com/appium/io.appium.settings/commit/0b8c64e99e54d5ed708f93f7ecf02e3402ce7843))
|
|
12
|
+
|
|
1
13
|
## [7.0.7](https://github.com/appium/io.appium.settings/compare/v7.0.6...v7.0.7) (2025-12-18)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
Binary file
|
|
@@ -1,38 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @property {number|string} longitude - Valid longitude value.
|
|
4
|
-
* @property {number|string} latitude - Valid latitude value.
|
|
5
|
-
* @property {number|string|null} [altitude] - Valid altitude value.
|
|
6
|
-
* @property {number|string|null} [satellites=12] - Number of satellites being tracked (1-12).
|
|
7
|
-
* This value is ignored on real devices.
|
|
8
|
-
* @property {number|string|null} [speed] - Valid speed value.
|
|
9
|
-
* https://developer.android.com/reference/android/location/Location#setSpeed(float)
|
|
10
|
-
* @property {number|string|null} [bearing] - Valid bearing value.
|
|
11
|
-
* https://developer.android.com/reference/android/location/Location#setBearing(float)
|
|
12
|
-
* @property {number|string|null} [accuracy] - Valid accuracy value.
|
|
13
|
-
* https://developer.android.com/reference/android/location/Location#setAccuracy(float),
|
|
14
|
-
* https://developer.android.com/reference/android/location/Criteria
|
|
15
|
-
* Should be greater than 0.0 meters/second for real devices or 0.0 knots
|
|
16
|
-
* for emulators.
|
|
17
|
-
*/
|
|
1
|
+
import type { SettingsApp } from '../client.js';
|
|
2
|
+
import type { Location } from './types.js';
|
|
18
3
|
/**
|
|
19
4
|
* Emulate geolocation coordinates on the device under test.
|
|
5
|
+
* The `altitude` value is ignored while mocking the position.
|
|
20
6
|
*
|
|
21
|
-
* @
|
|
22
|
-
* @param
|
|
23
|
-
*
|
|
24
|
-
* @param {boolean} [isEmulator=false] - Set it to true if the device under test
|
|
25
|
-
* is an emulator rather than a real device.
|
|
7
|
+
* @param location - Location object containing coordinates and optional metadata
|
|
8
|
+
* @param isEmulator - Set it to true if the device under test is an emulator rather than a real device
|
|
9
|
+
* @throws {Error} If required location values are missing or invalid
|
|
26
10
|
*/
|
|
27
|
-
export function setGeoLocation(this:
|
|
11
|
+
export declare function setGeoLocation(this: SettingsApp, location: Location, isEmulator?: boolean): Promise<void>;
|
|
28
12
|
/**
|
|
29
13
|
* Get the current cached GPS location from the device under test.
|
|
30
14
|
*
|
|
31
|
-
* @
|
|
32
|
-
* @returns {Promise<Location>} The current location
|
|
15
|
+
* @returns The current location
|
|
33
16
|
* @throws {Error} If the current location cannot be retrieved
|
|
34
17
|
*/
|
|
35
|
-
export function getGeoLocation(this:
|
|
18
|
+
export declare function getGeoLocation(this: SettingsApp): Promise<Location>;
|
|
36
19
|
/**
|
|
37
20
|
* Sends an async request to refresh the GPS cache.
|
|
38
21
|
* This feature only works if the device under test has
|
|
@@ -40,49 +23,9 @@ export function getGeoLocation(this: import("../client").SettingsApp): Promise<L
|
|
|
40
23
|
* LocationManager is used the device API level must be at
|
|
41
24
|
* version 30 (Android R) or higher.
|
|
42
25
|
*
|
|
43
|
-
* @
|
|
44
|
-
*
|
|
45
|
-
* to block until GPS cache is refreshed. Providing zero or a negative
|
|
46
|
-
* value to it skips waiting completely.
|
|
47
|
-
*
|
|
26
|
+
* @param timeoutMs The maximum number of milliseconds to block until GPS cache is refreshed.
|
|
27
|
+
* Providing zero or a negative value to it skips waiting completely.
|
|
48
28
|
* @throws {Error} If the GPS cache cannot be refreshed.
|
|
49
29
|
*/
|
|
50
|
-
export function refreshGeoLocationCache(this:
|
|
51
|
-
export type Location = {
|
|
52
|
-
/**
|
|
53
|
-
* - Valid longitude value.
|
|
54
|
-
*/
|
|
55
|
-
longitude: number | string;
|
|
56
|
-
/**
|
|
57
|
-
* - Valid latitude value.
|
|
58
|
-
*/
|
|
59
|
-
latitude: number | string;
|
|
60
|
-
/**
|
|
61
|
-
* - Valid altitude value.
|
|
62
|
-
*/
|
|
63
|
-
altitude?: string | number | null | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* - Number of satellites being tracked (1-12).
|
|
66
|
-
* This value is ignored on real devices.
|
|
67
|
-
*/
|
|
68
|
-
satellites?: string | number | null | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* - Valid speed value.
|
|
71
|
-
* https://developer.android.com/reference/android/location/Location#setSpeed(float)
|
|
72
|
-
*/
|
|
73
|
-
speed?: string | number | null | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* - Valid bearing value.
|
|
76
|
-
* https://developer.android.com/reference/android/location/Location#setBearing(float)
|
|
77
|
-
*/
|
|
78
|
-
bearing?: string | number | null | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* - Valid accuracy value.
|
|
81
|
-
* https://developer.android.com/reference/android/location/Location#setAccuracy(float),
|
|
82
|
-
* https://developer.android.com/reference/android/location/Criteria
|
|
83
|
-
* Should be greater than 0.0 meters/second for real devices or 0.0 knots
|
|
84
|
-
* for emulators.
|
|
85
|
-
*/
|
|
86
|
-
accuracy?: string | number | null | undefined;
|
|
87
|
-
};
|
|
30
|
+
export declare function refreshGeoLocationCache(this: SettingsApp, timeoutMs?: number): Promise<void>;
|
|
88
31
|
//# sourceMappingURL=geolocation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/commands/geolocation.
|
|
1
|
+
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAY3C;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA+E7G;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiBzE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,SAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDjG"}
|
|
@@ -19,31 +19,13 @@ const GPS_CACHE_REFRESHED_LOGS = [
|
|
|
19
19
|
'The current location has been successfully retrieved from Location Manager'
|
|
20
20
|
];
|
|
21
21
|
const GPS_COORDINATES_PATTERN = /data="(-?[\d.]+)\s+(-?[\d.]+)\s+(-?[\d.]+)"/;
|
|
22
|
-
/**
|
|
23
|
-
* @typedef {Object} Location
|
|
24
|
-
* @property {number|string} longitude - Valid longitude value.
|
|
25
|
-
* @property {number|string} latitude - Valid latitude value.
|
|
26
|
-
* @property {number|string|null} [altitude] - Valid altitude value.
|
|
27
|
-
* @property {number|string|null} [satellites=12] - Number of satellites being tracked (1-12).
|
|
28
|
-
* This value is ignored on real devices.
|
|
29
|
-
* @property {number|string|null} [speed] - Valid speed value.
|
|
30
|
-
* https://developer.android.com/reference/android/location/Location#setSpeed(float)
|
|
31
|
-
* @property {number|string|null} [bearing] - Valid bearing value.
|
|
32
|
-
* https://developer.android.com/reference/android/location/Location#setBearing(float)
|
|
33
|
-
* @property {number|string|null} [accuracy] - Valid accuracy value.
|
|
34
|
-
* https://developer.android.com/reference/android/location/Location#setAccuracy(float),
|
|
35
|
-
* https://developer.android.com/reference/android/location/Criteria
|
|
36
|
-
* Should be greater than 0.0 meters/second for real devices or 0.0 knots
|
|
37
|
-
* for emulators.
|
|
38
|
-
*/
|
|
39
22
|
/**
|
|
40
23
|
* Emulate geolocation coordinates on the device under test.
|
|
24
|
+
* The `altitude` value is ignored while mocking the position.
|
|
41
25
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @param
|
|
44
|
-
*
|
|
45
|
-
* @param {boolean} [isEmulator=false] - Set it to true if the device under test
|
|
46
|
-
* is an emulator rather than a real device.
|
|
26
|
+
* @param location - Location object containing coordinates and optional metadata
|
|
27
|
+
* @param isEmulator - Set it to true if the device under test is an emulator rather than a real device
|
|
28
|
+
* @throws {Error} If required location values are missing or invalid
|
|
47
29
|
*/
|
|
48
30
|
async function setGeoLocation(location, isEmulator = false) {
|
|
49
31
|
const formatLocationValue = (valueName, isRequired = true) => {
|
|
@@ -53,7 +35,7 @@ async function setGeoLocation(location, isEmulator = false) {
|
|
|
53
35
|
}
|
|
54
36
|
return null;
|
|
55
37
|
}
|
|
56
|
-
const floatValue = parseFloat(location[valueName]);
|
|
38
|
+
const floatValue = parseFloat(String(location[valueName]));
|
|
57
39
|
if (!isNaN(floatValue)) {
|
|
58
40
|
return `${lodash_1.default.ceil(floatValue, 5)}`;
|
|
59
41
|
}
|
|
@@ -63,14 +45,13 @@ async function setGeoLocation(location, isEmulator = false) {
|
|
|
63
45
|
}
|
|
64
46
|
return null;
|
|
65
47
|
};
|
|
66
|
-
const longitude =
|
|
67
|
-
const latitude =
|
|
48
|
+
const longitude = formatLocationValue('longitude');
|
|
49
|
+
const latitude = formatLocationValue('latitude');
|
|
68
50
|
const altitude = formatLocationValue('altitude', false);
|
|
69
51
|
const speed = formatLocationValue('speed', false);
|
|
70
52
|
const bearing = formatLocationValue('bearing', false);
|
|
71
53
|
const accuracy = formatLocationValue('accuracy', false);
|
|
72
54
|
if (isEmulator) {
|
|
73
|
-
/** @type {string[]} */
|
|
74
55
|
const args = [longitude, latitude];
|
|
75
56
|
if (!lodash_1.default.isNil(altitude)) {
|
|
76
57
|
args.push(altitude);
|
|
@@ -130,8 +111,7 @@ async function setGeoLocation(location, isEmulator = false) {
|
|
|
130
111
|
/**
|
|
131
112
|
* Get the current cached GPS location from the device under test.
|
|
132
113
|
*
|
|
133
|
-
* @
|
|
134
|
-
* @returns {Promise<Location>} The current location
|
|
114
|
+
* @returns The current location
|
|
135
115
|
* @throws {Error} If the current location cannot be retrieved
|
|
136
116
|
*/
|
|
137
117
|
async function getGeoLocation() {
|
|
@@ -158,11 +138,8 @@ async function getGeoLocation() {
|
|
|
158
138
|
* LocationManager is used the device API level must be at
|
|
159
139
|
* version 30 (Android R) or higher.
|
|
160
140
|
*
|
|
161
|
-
* @
|
|
162
|
-
*
|
|
163
|
-
* to block until GPS cache is refreshed. Providing zero or a negative
|
|
164
|
-
* value to it skips waiting completely.
|
|
165
|
-
*
|
|
141
|
+
* @param timeoutMs The maximum number of milliseconds to block until GPS cache is refreshed.
|
|
142
|
+
* Providing zero or a negative value to it skips waiting completely.
|
|
166
143
|
* @throws {Error} If the GPS cache cannot be refreshed.
|
|
167
144
|
*/
|
|
168
145
|
async function refreshGeoLocationCache(timeoutMs = 20000) {
|
|
@@ -179,10 +156,11 @@ async function refreshGeoLocationCache(timeoutMs = 20000) {
|
|
|
179
156
|
`Please make sure the device under test has Appium Settings app installed and running. ` +
|
|
180
157
|
`Also, it is required that the device has Google Play Services installed or is running ` +
|
|
181
158
|
`Android 10+ otherwise.`;
|
|
159
|
+
const monitor = logcatMonitor;
|
|
182
160
|
monitoringPromise = new bluebird_1.default((resolve, reject) => {
|
|
183
161
|
setTimeout(() => reject(new Error(timeoutErrorMsg)), timeoutMs);
|
|
184
|
-
|
|
185
|
-
['lines-stderr', 'lines-stdout'].map((evt) =>
|
|
162
|
+
monitor.on('exit', () => reject(new Error(timeoutErrorMsg)));
|
|
163
|
+
['lines-stderr', 'lines-stdout'].map((evt) => monitor.on(evt, (lines) => {
|
|
186
164
|
if (lines.some((line) => GPS_CACHE_REFRESHED_LOGS.some((x) => line.includes(x)))) {
|
|
187
165
|
resolve();
|
|
188
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.
|
|
1
|
+
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":";;;;;AA8BA,wCA+EC;AAQD,wCAiBC;AAaD,0DAmDC;AAtMD,oDAAuB;AACvB,kDAIyB;AACzB,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AAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACjF,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC,CAAC,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,IAAI,CAAC,cAAc,CAAC;QACxB,IAAI,EAAE,gCAAiB;QACvB,IAAI,EAAE,wCAAyB;QAC/B,MAAM,EAAE,aAAa,EAAE,MAAM;KAC9B,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAE/B,IAAI,aAAa,IAAI,iBAAiB,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAU,EAAE,iBAAiB,SAAS,sCAAsC,CAAC,CAAC;QAC7F,IAAI,CAAC;YACH,MAAM,iBAAiB,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAU,EAAE,sDAAsD;gBAC9E,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;gBAAS,CAAC;YACT,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;gBAC5B,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAU,EAAE,sFAAsF,CAAC,CAAC;IACpH,CAAC;AACH,CAAC"}
|
|
@@ -1,74 +1,61 @@
|
|
|
1
|
+
import type { ADB } from 'appium-adb';
|
|
2
|
+
import type { SettingsApp } from '../client.js';
|
|
3
|
+
import type { StartMediaProjectionRecordingOpts } from './types.js';
|
|
1
4
|
/**
|
|
2
|
-
* Creates a new instance of the MediaProjection-based recorder
|
|
5
|
+
* Creates a new instance of the MediaProjection-based recorder.
|
|
3
6
|
* The recorder only works since Android API 29+
|
|
4
7
|
*
|
|
5
|
-
* @
|
|
6
|
-
* @returns {MediaProjectionRecorder} The recorder instance
|
|
8
|
+
* @returns The recorder instance
|
|
7
9
|
*/
|
|
8
|
-
export function makeMediaProjectionRecorder(this:
|
|
10
|
+
export declare function makeMediaProjectionRecorder(this: SettingsApp): MediaProjectionRecorder;
|
|
9
11
|
/**
|
|
10
|
-
* Adjusts the necessary permissions for the
|
|
11
|
-
*
|
|
12
|
+
* Adjusts the necessary permissions for the Media Projection-based recording service.
|
|
13
|
+
* This method only applies to devices running Android API 29 or higher.
|
|
12
14
|
*
|
|
13
|
-
* @
|
|
14
|
-
|
|
15
|
+
* @returns True if permissions were adjusted, false if device API level is below 29
|
|
16
|
+
*/
|
|
17
|
+
export declare function adjustMediaProjectionServicePermissions(this: SettingsApp): Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Media projection recorder for capturing device screen recordings.
|
|
20
|
+
* This class provides methods to start, stop, and manage screen recordings
|
|
21
|
+
* using Android's MediaProjection API (API 29+).
|
|
15
22
|
*/
|
|
16
|
-
export function adjustMediaProjectionServicePermissions(this: import("../client").SettingsApp): Promise<boolean>;
|
|
17
|
-
export type ADB = import("appium-adb").ADB;
|
|
18
|
-
export type StartMediaProjectionRecordingOpts = {
|
|
19
|
-
/**
|
|
20
|
-
* Maximum supported resolution on-device (Detected automatically by the app
|
|
21
|
-
* itself), which usually equals to Full HD 1920x1080 on most phones however
|
|
22
|
-
* you can change it to following supported resolutions as well: "1920x1080",
|
|
23
|
-
* "1280x720", "720x480", "320x240", "176x144".
|
|
24
|
-
*/
|
|
25
|
-
resolution?: string | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Maximum allowed duration is 15 minutes; you can increase it if your test
|
|
28
|
-
* takes longer than that.
|
|
29
|
-
*/
|
|
30
|
-
maxDurationSec?: number | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Recording thread priority.
|
|
33
|
-
* If you face performance drops during testing with recording enabled, you
|
|
34
|
-
* can reduce recording priority
|
|
35
|
-
*/
|
|
36
|
-
priority?: "high" | "normal" | "low" | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* You can type recording video file name as you want, but recording currently
|
|
39
|
-
* supports only "mp4" format so your filename must end with ".mp4". An
|
|
40
|
-
* invalid file name will fail to start the recording.
|
|
41
|
-
*/
|
|
42
|
-
filename?: string | undefined;
|
|
43
|
-
};
|
|
44
23
|
declare class MediaProjectionRecorder {
|
|
24
|
+
private readonly adb;
|
|
45
25
|
/**
|
|
46
|
-
*
|
|
26
|
+
* Creates a new MediaProjectionRecorder instance.
|
|
27
|
+
*
|
|
28
|
+
* @param adb - ADB instance for device communication
|
|
47
29
|
*/
|
|
48
30
|
constructor(adb: ADB);
|
|
49
|
-
adb: import("appium-adb").default;
|
|
50
31
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @returns {Promise<boolean>}
|
|
32
|
+
* Checks if the recording is currently running.
|
|
53
33
|
*/
|
|
54
34
|
isRunning(): Promise<boolean>;
|
|
55
35
|
/**
|
|
36
|
+
* Starts the media projection recording.
|
|
37
|
+
* If a recording is already running, this method will return false without starting a new one.
|
|
56
38
|
*
|
|
57
|
-
* @param
|
|
58
|
-
* @returns
|
|
39
|
+
* @param opts Recording options including filename, resolution, duration, and priority
|
|
40
|
+
* @returns True if recording was started successfully, false if already running
|
|
41
|
+
* @throws {Error} If recording fails to start within the timeout period
|
|
59
42
|
*/
|
|
60
43
|
start(opts?: StartMediaProjectionRecordingOpts): Promise<boolean>;
|
|
61
44
|
/**
|
|
62
|
-
*
|
|
45
|
+
* Cleans up old recording files.
|
|
63
46
|
*/
|
|
64
47
|
cleanup(): Promise<void>;
|
|
65
48
|
/**
|
|
49
|
+
* Pulls the most recent recording file from the device.
|
|
66
50
|
*
|
|
67
|
-
* @returns
|
|
51
|
+
* @returns Path to the pulled file, or null if no recordings exist
|
|
68
52
|
*/
|
|
69
53
|
pullRecent(): Promise<string | null>;
|
|
70
54
|
/**
|
|
71
|
-
*
|
|
55
|
+
* Stops the current recording.
|
|
56
|
+
*
|
|
57
|
+
* @returns True if recording was stopped successfully, false if no recording was running
|
|
58
|
+
* @throws {Error} If the recording fails to stop within the timeout period
|
|
72
59
|
*/
|
|
73
60
|
stop(): Promise<boolean>;
|
|
74
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-projection.d.ts","sourceRoot":"","sources":["../../../lib/commands/media-projection.
|
|
1
|
+
{"version":3,"file":"media-projection.d.ts","sourceRoot":"","sources":["../../../lib/commands/media-projection.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,WAAW,GAAG,uBAAuB,CAEtF;AAED;;;;;GAKG;AACH,wBAAsB,uCAAuC,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAMjG;AAMD;;;;GAIG;AACH,cAAM,uBAAuB;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B;;;;OAIG;gBACS,GAAG,EAAE,GAAG;IAIpB;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAUnC;;;;;;;OAOG;IACG,KAAK,CAAC,IAAI,GAAE,iCAAsC,GAAG,OAAO,CAAC,OAAO,CAAC;IAqC3E;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAa1C;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CA0B/B"}
|
|
@@ -10,34 +10,66 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
10
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
11
11
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
12
12
|
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
-
const
|
|
13
|
+
const constants_js_1 = require("../constants.js");
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new instance of the MediaProjection-based recorder.
|
|
16
|
+
* The recorder only works since Android API 29+
|
|
17
|
+
*
|
|
18
|
+
* @returns The recorder instance
|
|
19
|
+
*/
|
|
20
|
+
function makeMediaProjectionRecorder() {
|
|
21
|
+
return new MediaProjectionRecorder(this.adb);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Adjusts the necessary permissions for the Media Projection-based recording service.
|
|
25
|
+
* This method only applies to devices running Android API 29 or higher.
|
|
26
|
+
*
|
|
27
|
+
* @returns True if permissions were adjusted, false if device API level is below 29
|
|
28
|
+
*/
|
|
29
|
+
async function adjustMediaProjectionServicePermissions() {
|
|
30
|
+
if (await this.adb.getApiLevel() >= 29) {
|
|
31
|
+
await this.adb.shell(['appops', 'set', constants_js_1.SETTINGS_HELPER_ID, 'PROJECT_MEDIA', 'allow']);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
14
36
|
const RECORDING_STARTUP_TIMEOUT_MS = 3 * 1000;
|
|
15
37
|
const RECORDING_STOP_TIMEOUT_MS = 3 * 1000;
|
|
16
|
-
const RECORDINGS_ROOT = `/storage/emulated/0/Android/data/${
|
|
38
|
+
const RECORDINGS_ROOT = `/storage/emulated/0/Android/data/${constants_js_1.SETTINGS_HELPER_ID}/files`;
|
|
39
|
+
/**
|
|
40
|
+
* Media projection recorder for capturing device screen recordings.
|
|
41
|
+
* This class provides methods to start, stop, and manage screen recordings
|
|
42
|
+
* using Android's MediaProjection API (API 29+).
|
|
43
|
+
*/
|
|
17
44
|
class MediaProjectionRecorder {
|
|
45
|
+
adb;
|
|
18
46
|
/**
|
|
19
|
-
*
|
|
47
|
+
* Creates a new MediaProjectionRecorder instance.
|
|
48
|
+
*
|
|
49
|
+
* @param adb - ADB instance for device communication
|
|
20
50
|
*/
|
|
21
51
|
constructor(adb) {
|
|
22
52
|
this.adb = adb;
|
|
23
53
|
}
|
|
24
54
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @returns {Promise<boolean>}
|
|
55
|
+
* Checks if the recording is currently running.
|
|
27
56
|
*/
|
|
28
57
|
async isRunning() {
|
|
29
58
|
const stdout = await this.adb.shell([
|
|
30
59
|
'dumpsys',
|
|
31
60
|
'activity',
|
|
32
61
|
'services',
|
|
33
|
-
|
|
62
|
+
constants_js_1.RECORDING_SERVICE_NAME,
|
|
34
63
|
]);
|
|
35
|
-
return stdout.includes(
|
|
64
|
+
return stdout.includes(constants_js_1.RECORDING_SERVICE_NAME);
|
|
36
65
|
}
|
|
37
66
|
/**
|
|
67
|
+
* Starts the media projection recording.
|
|
68
|
+
* If a recording is already running, this method will return false without starting a new one.
|
|
38
69
|
*
|
|
39
|
-
* @param
|
|
40
|
-
* @returns
|
|
70
|
+
* @param opts Recording options including filename, resolution, duration, and priority
|
|
71
|
+
* @returns True if recording was started successfully, false if already running
|
|
72
|
+
* @throws {Error} If recording fails to start within the timeout period
|
|
41
73
|
*/
|
|
42
74
|
async start(opts = {}) {
|
|
43
75
|
if (await this.isRunning()) {
|
|
@@ -45,7 +77,7 @@ class MediaProjectionRecorder {
|
|
|
45
77
|
}
|
|
46
78
|
await this.cleanup();
|
|
47
79
|
const { filename, maxDurationSec, priority, resolution } = opts;
|
|
48
|
-
const args = ['am', 'start', '-n',
|
|
80
|
+
const args = ['am', 'start', '-n', constants_js_1.RECORDING_ACTIVITY_NAME, '-a', constants_js_1.RECORDING_ACTION_START];
|
|
49
81
|
if (filename) {
|
|
50
82
|
args.push('--es', 'filename', filename);
|
|
51
83
|
}
|
|
@@ -71,14 +103,15 @@ class MediaProjectionRecorder {
|
|
|
71
103
|
return true;
|
|
72
104
|
}
|
|
73
105
|
/**
|
|
74
|
-
*
|
|
106
|
+
* Cleans up old recording files.
|
|
75
107
|
*/
|
|
76
108
|
async cleanup() {
|
|
77
109
|
await this.adb.shell([`rm -f ${RECORDINGS_ROOT}/*`]);
|
|
78
110
|
}
|
|
79
111
|
/**
|
|
112
|
+
* Pulls the most recent recording file from the device.
|
|
80
113
|
*
|
|
81
|
-
* @returns
|
|
114
|
+
* @returns Path to the pulled file, or null if no recordings exist
|
|
82
115
|
*/
|
|
83
116
|
async pullRecent() {
|
|
84
117
|
const recordings = await this.adb.ls(RECORDINGS_ROOT, ['-tr']);
|
|
@@ -92,7 +125,10 @@ class MediaProjectionRecorder {
|
|
|
92
125
|
return dstPath;
|
|
93
126
|
}
|
|
94
127
|
/**
|
|
95
|
-
*
|
|
128
|
+
* Stops the current recording.
|
|
129
|
+
*
|
|
130
|
+
* @returns True if recording was stopped successfully, false if no recording was running
|
|
131
|
+
* @throws {Error} If the recording fails to stop within the timeout period
|
|
96
132
|
*/
|
|
97
133
|
async stop() {
|
|
98
134
|
if (!(await this.isRunning())) {
|
|
@@ -102,9 +138,9 @@ class MediaProjectionRecorder {
|
|
|
102
138
|
'am',
|
|
103
139
|
'start',
|
|
104
140
|
'-n',
|
|
105
|
-
|
|
141
|
+
constants_js_1.RECORDING_ACTIVITY_NAME,
|
|
106
142
|
'-a',
|
|
107
|
-
|
|
143
|
+
constants_js_1.RECORDING_ACTION_STOP,
|
|
108
144
|
]);
|
|
109
145
|
try {
|
|
110
146
|
await (0, asyncbox_1.waitForCondition)(async () => !(await this.isRunning()), {
|
|
@@ -119,46 +155,4 @@ class MediaProjectionRecorder {
|
|
|
119
155
|
return true;
|
|
120
156
|
}
|
|
121
157
|
}
|
|
122
|
-
/**
|
|
123
|
-
* Creates a new instance of the MediaProjection-based recorder
|
|
124
|
-
* The recorder only works since Android API 29+
|
|
125
|
-
*
|
|
126
|
-
* @this {import('../client').SettingsApp}
|
|
127
|
-
* @returns {MediaProjectionRecorder} The recorder instance
|
|
128
|
-
*/
|
|
129
|
-
function makeMediaProjectionRecorder() {
|
|
130
|
-
return new MediaProjectionRecorder(this.adb);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Adjusts the necessary permissions for the
|
|
134
|
-
* Media Projection-based recording service
|
|
135
|
-
*
|
|
136
|
-
* @this {import('../client').SettingsApp}
|
|
137
|
-
* @returns {Promise<boolean>} If the permissions adjustment has actually been made
|
|
138
|
-
*/
|
|
139
|
-
async function adjustMediaProjectionServicePermissions() {
|
|
140
|
-
if (await this.adb.getApiLevel() >= 29) {
|
|
141
|
-
await this.adb.shell(['appops', 'set', constants_1.SETTINGS_HELPER_ID, 'PROJECT_MEDIA', 'allow']);
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* @typedef {import('appium-adb').ADB} ADB
|
|
148
|
-
*/
|
|
149
|
-
/**
|
|
150
|
-
* @typedef {Object} StartMediaProjectionRecordingOpts
|
|
151
|
-
* @property {string} [resolution] Maximum supported resolution on-device (Detected automatically by the app
|
|
152
|
-
* itself), which usually equals to Full HD 1920x1080 on most phones however
|
|
153
|
-
* you can change it to following supported resolutions as well: "1920x1080",
|
|
154
|
-
* "1280x720", "720x480", "320x240", "176x144".
|
|
155
|
-
* @property {number} [maxDurationSec=900] Maximum allowed duration is 15 minutes; you can increase it if your test
|
|
156
|
-
* takes longer than that.
|
|
157
|
-
* @property {'high' | 'normal' | 'low'} [priority='high'] Recording thread priority.
|
|
158
|
-
* If you face performance drops during testing with recording enabled, you
|
|
159
|
-
* can reduce recording priority
|
|
160
|
-
* @property {string} [filename] You can type recording video file name as you want, but recording currently
|
|
161
|
-
* supports only "mp4" format so your filename must end with ".mp4". An
|
|
162
|
-
* invalid file name will fail to start the recording.
|
|
163
|
-
*/
|
|
164
158
|
//# sourceMappingURL=media-projection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-projection.js","sourceRoot":"","sources":["../../../lib/commands/media-projection.
|
|
1
|
+
{"version":3,"file":"media-projection.js","sourceRoot":"","sources":["../../../lib/commands/media-projection.ts"],"names":[],"mappings":";;;;;AAsBA,kEAEC;AAQD,0FAMC;AAtCD,uCAA0C;AAC1C,wDAAyB;AACzB,oDAAuB;AACvB,2DAA6B;AAC7B,0DAA6B;AAC7B,kDAMyB;AAKzB;;;;;GAKG;AACH,SAAgB,2BAA2B;IACzC,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,uCAAuC;IAC3D,IAAI,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,iCAAkB,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,4BAA4B,GAAG,CAAC,GAAG,IAAI,CAAC;AAC9C,MAAM,yBAAyB,GAAG,CAAC,GAAG,IAAI,CAAC;AAC3C,MAAM,eAAe,GAAG,oCAAoC,iCAAkB,QAAQ,CAAC;AAEvF;;;;GAIG;AACH,MAAM,uBAAuB;IACV,GAAG,CAAM;IAE1B;;;;OAIG;IACH,YAAY,GAAQ;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAClC,SAAS;YACT,UAAU;YACV,UAAU;YACV,qCAAsB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,CAAC;QACH,IAAI,CAAC;YACH,MAAM,IAAA,2BAAgB,EAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE;gBAC5D,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,6EAA6E;gBAC3E,GAAG,yBAAyB,IAAI,CACnC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location object containing geolocation coordinates and optional metadata.
|
|
3
|
+
*/
|
|
4
|
+
export interface Location {
|
|
5
|
+
longitude: number | string;
|
|
6
|
+
latitude: number | string;
|
|
7
|
+
altitude?: number | string | null;
|
|
8
|
+
/** Number of satellites being tracked (1-12). This value is ignored on real devices. */
|
|
9
|
+
satellites?: number | string | null;
|
|
10
|
+
/** Valid speed value. https://developer.android.com/reference/android/location/Location#setSpeed(float) */
|
|
11
|
+
speed?: number | string | null;
|
|
12
|
+
/** Valid bearing value. https://developer.android.com/reference/android/location/Location#setBearing(float) */
|
|
13
|
+
bearing?: number | string | null;
|
|
14
|
+
/** Valid accuracy value. https://developer.android.com/reference/android/location/Location#setAccuracy(float), https://developer.android.com/reference/android/location/Criteria. Should be greater than 0.0 meters/second for real devices or 0.0 knots for emulators. */
|
|
15
|
+
accuracy?: number | string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Options for starting a media projection recording session.
|
|
19
|
+
*/
|
|
20
|
+
export interface StartMediaProjectionRecordingOpts {
|
|
21
|
+
/** Maximum supported resolution on-device (Detected automatically by the app
|
|
22
|
+
* itself), which usually equals to Full HD 1920x1080 on most phones however
|
|
23
|
+
* you can change it to following supported resolutions as well: "1920x1080",
|
|
24
|
+
* "1280x720", "720x480", "320x240", "176x144". */
|
|
25
|
+
resolution?: string;
|
|
26
|
+
/** Maximum allowed duration is 15 minutes; you can increase it if your test
|
|
27
|
+
* takes longer than that. */
|
|
28
|
+
maxDurationSec?: number;
|
|
29
|
+
/** Recording thread priority.
|
|
30
|
+
* If you face performance drops during testing with recording enabled, you
|
|
31
|
+
* can reduce recording priority */
|
|
32
|
+
priority?: 'high' | 'normal' | 'low';
|
|
33
|
+
/** You can type recording video file name as you want, but recording currently
|
|
34
|
+
* supports only "mp4" format so your filename must end with ".mp4". An
|
|
35
|
+
* invalid file name will fail to start the recording. */
|
|
36
|
+
filename?: string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/commands/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,2GAA2G;IAC3G,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,+GAA+G;IAC/G,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,2QAA2Q;IAC3Q,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;sDAGkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;iCAC6B;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;uCAEmC;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACrC;;6DAEyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/commands/types.ts"],"names":[],"mappings":""}
|