appium-mac2-driver 3.2.2 → 3.2.3
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 +8 -0
- package/build/lib/doctor/optional-checks.d.ts +12 -10
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +9 -9
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts +12 -10
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js +9 -9
- package/build/lib/doctor/required-checks.js.map +1 -1
- package/build/lib/doctor/utils.d.ts +3 -3
- package/build/lib/doctor/utils.d.ts.map +1 -1
- package/build/lib/doctor/utils.js +2 -2
- package/build/lib/doctor/utils.js.map +1 -1
- package/build/lib/logger.d.ts +1 -1
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/utils.d.ts +11 -11
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +6 -7
- package/build/lib/utils.js.map +1 -1
- package/lib/doctor/optional-checks.ts +67 -0
- package/lib/doctor/required-checks.ts +75 -0
- package/lib/doctor/{utils.js → utils.ts} +4 -3
- package/lib/{logger.js → logger.ts} +1 -0
- package/lib/{utils.js → utils.ts} +8 -10
- package/npm-shrinkwrap.json +13 -13
- package/package.json +1 -1
- package/lib/doctor/optional-checks.js +0 -64
- package/lib/doctor/required-checks.js +0 -72
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [3.2.3](https://github.com/appium/appium-mac2-driver/compare/v3.2.2...v3.2.3) (2025-11-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Miscellaneous Chores
|
|
5
|
+
|
|
6
|
+
* Migrate doctor checks to typescript ([#351](https://github.com/appium/appium-mac2-driver/issues/351)) ([66057a4](https://github.com/appium/appium-mac2-driver/commit/66057a41612d5ac71cfa10a04da1eea4fddbdc17))
|
|
7
|
+
* Migrate logger and utils to typescipt ([#352](https://github.com/appium/appium-mac2-driver/issues/352)) ([9a51427](https://github.com/appium/appium-mac2-driver/commit/9a514271f1169ff29b878b7ea53b330bed5ab3c5))
|
|
8
|
+
|
|
1
9
|
## [3.2.2](https://github.com/appium/appium-mac2-driver/compare/v3.2.1...v3.2.2) (2025-11-14)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { IDoctorCheck, AppiumLogger, DoctorCheckResult } from '@appium/types';
|
|
2
|
+
import '@colors/colors';
|
|
3
|
+
export declare class OptionalFfmpegCheck implements IDoctorCheck {
|
|
4
|
+
log: AppiumLogger;
|
|
5
|
+
static readonly FFMPEG_BINARY = "ffmpeg";
|
|
6
|
+
static readonly FFMPEG_INSTALL_LINK = "https://www.ffmpeg.org/download.html";
|
|
7
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
6
8
|
fix(): Promise<string>;
|
|
7
9
|
hasAutofix(): boolean;
|
|
8
10
|
isOptional(): boolean;
|
|
9
11
|
}
|
|
10
|
-
export const optionalFfmpegCheck: OptionalFfmpegCheck;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
diagnose(): Promise<
|
|
12
|
+
export declare const optionalFfmpegCheck: OptionalFfmpegCheck;
|
|
13
|
+
export declare class OptionalAutomationModeCheck implements IDoctorCheck {
|
|
14
|
+
log: AppiumLogger;
|
|
15
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
14
16
|
fix(): Promise<string>;
|
|
15
17
|
hasAutofix(): boolean;
|
|
16
18
|
isOptional(): boolean;
|
|
17
19
|
}
|
|
18
|
-
export const optionalAutomationModeCheck: OptionalAutomationModeCheck;
|
|
20
|
+
export declare const optionalAutomationModeCheck: OptionalAutomationModeCheck;
|
|
19
21
|
//# sourceMappingURL=optional-checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optional-checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/optional-checks.
|
|
1
|
+
{"version":3,"file":"optional-checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/optional-checks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,gBAAgB,CAAC;AAExB,qBAAa,mBAAoB,YAAW,YAAY;IACtD,GAAG,EAAG,YAAY,CAAC;IACnB,MAAM,CAAC,QAAQ,CAAC,aAAa,YAAY;IACzC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,0CAA0C;IAEvE,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAQtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAO5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,mBAAmB,qBAA4B,CAAC;AAG7D,qBAAa,2BAA4B,YAAW,YAAY;IAC9D,GAAG,EAAG,YAAY,CAAC;IAEb,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAatC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,2BAA2B,6BAAoC,CAAC"}
|
|
@@ -5,19 +5,19 @@ const utils_1 = require("./utils");
|
|
|
5
5
|
const support_1 = require("appium/support");
|
|
6
6
|
const teen_process_1 = require("teen_process");
|
|
7
7
|
require("@colors/colors");
|
|
8
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
9
8
|
class OptionalFfmpegCheck {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
log;
|
|
10
|
+
static FFMPEG_BINARY = 'ffmpeg';
|
|
11
|
+
static FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
12
12
|
async diagnose() {
|
|
13
|
-
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(
|
|
13
|
+
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(OptionalFfmpegCheck.FFMPEG_BINARY);
|
|
14
14
|
return ffmpegPath
|
|
15
|
-
? support_1.doctor.okOptional(`${
|
|
16
|
-
: support_1.doctor.nokOptional(`${
|
|
15
|
+
? support_1.doctor.okOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
16
|
+
: support_1.doctor.nokOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} cannot be found`);
|
|
17
17
|
}
|
|
18
18
|
async fix() {
|
|
19
|
-
return (`${`${
|
|
20
|
-
`Please read ${
|
|
19
|
+
return (`${`${OptionalFfmpegCheck.FFMPEG_BINARY}`.bold} is used to capture screen recordings. ` +
|
|
20
|
+
`Please read ${OptionalFfmpegCheck.FFMPEG_INSTALL_LINK}.`);
|
|
21
21
|
}
|
|
22
22
|
hasAutofix() {
|
|
23
23
|
return false;
|
|
@@ -28,8 +28,8 @@ class OptionalFfmpegCheck {
|
|
|
28
28
|
}
|
|
29
29
|
exports.OptionalFfmpegCheck = OptionalFfmpegCheck;
|
|
30
30
|
exports.optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
31
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
32
31
|
class OptionalAutomationModeCheck {
|
|
32
|
+
log;
|
|
33
33
|
async diagnose() {
|
|
34
34
|
let stdout;
|
|
35
35
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optional-checks.js","sourceRoot":"","sources":["../../../lib/doctor/optional-checks.
|
|
1
|
+
{"version":3,"file":"optional-checks.js","sourceRoot":"","sources":["../../../lib/doctor/optional-checks.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAC9C,4CAAsC;AACtC,+CAAkC;AAElC,0BAAwB;AAExB,MAAa,mBAAmB;IAC9B,GAAG,CAAgB;IACnB,MAAM,CAAU,aAAa,GAAG,QAAQ,CAAC;IACzC,MAAM,CAAU,mBAAmB,GAAG,sCAAsC,CAAC;IAE7E,KAAK,CAAC,QAAQ;QACZ,MAAM,UAAU,GAAG,MAAM,IAAA,6BAAqB,EAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAElF,OAAO,UAAU;YACf,CAAC,CAAC,gBAAM,CAAC,UAAU,CAAC,GAAG,mBAAmB,CAAC,aAAa,eAAe,UAAU,GAAG,CAAC;YACrF,CAAC,CAAC,gBAAM,CAAC,WAAW,CAAC,GAAG,mBAAmB,CAAC,aAAa,kBAAkB,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CACL,GAAG,GAAG,mBAAmB,CAAC,aAAa,EAAE,CAAC,IAAI,yCAAyC;YACvF,eAAe,mBAAmB,CAAC,mBAAmB,GAAG,CAC1D,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;;AA1BH,kDA2BC;AACY,QAAA,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAG7D,MAAa,2BAA2B;IACtC,GAAG,CAAgB;IAEnB,KAAK,CAAC,QAAQ;QACZ,IAAI,MAAc,CAAC;QACnB,IAAI,CAAC;YACH,CAAC,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,oBAAoB,CAAC,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,gBAAM,CAAC,WAAW,CAAC,oCAAqC,GAAW,CAAC,MAAM,IAAK,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACjH,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACxC,OAAO,gBAAM,CAAC,UAAU,CAAC,sDAAsD,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,gBAAM,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,mHAAmH,CAAC;IAC7H,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA3BD,kEA2BC;AACY,QAAA,2BAA2B,GAAG,IAAI,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { IDoctorCheck, AppiumLogger, DoctorCheckResult } from '@appium/types';
|
|
2
|
+
import '@colors/colors';
|
|
3
|
+
export declare class XcodeCheck implements IDoctorCheck {
|
|
4
|
+
log: AppiumLogger;
|
|
5
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
4
6
|
fix(): Promise<string>;
|
|
5
7
|
hasAutofix(): boolean;
|
|
6
8
|
isOptional(): boolean;
|
|
7
9
|
}
|
|
8
|
-
export const xcodeCheck: XcodeCheck;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
XCODE_VER_PATTERN: RegExp;
|
|
12
|
-
MIN_XCODE_VERSION
|
|
13
|
-
diagnose(): Promise<
|
|
10
|
+
export declare const xcodeCheck: XcodeCheck;
|
|
11
|
+
export declare class XcodebuildCheck implements IDoctorCheck {
|
|
12
|
+
log: AppiumLogger;
|
|
13
|
+
static readonly XCODE_VER_PATTERN: RegExp;
|
|
14
|
+
static readonly MIN_XCODE_VERSION = 13;
|
|
15
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
14
16
|
fix(): Promise<string>;
|
|
15
17
|
hasAutofix(): boolean;
|
|
16
18
|
isOptional(): boolean;
|
|
17
19
|
}
|
|
18
|
-
export const xcodebuildCheck: XcodebuildCheck;
|
|
20
|
+
export declare const xcodebuildCheck: XcodebuildCheck;
|
|
19
21
|
//# sourceMappingURL=required-checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/required-checks.
|
|
1
|
+
{"version":3,"file":"required-checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/required-checks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,gBAAgB,CAAC;AAGxB,qBAAa,UAAW,YAAW,YAAY;IAC7C,GAAG,EAAG,YAAY,CAAC;IAEb,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAStC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,UAAU,YAAmB,CAAC;AAG3C,qBAAa,eAAgB,YAAW,YAAY;IAClD,GAAG,EAAG,YAAY,CAAC;IACnB,MAAM,CAAC,QAAQ,CAAC,iBAAiB,SAAyB;IAC1D,MAAM,CAAC,QAAQ,CAAC,iBAAiB,MAAM;IAEjC,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAsBtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
|
|
@@ -5,8 +5,8 @@ const support_1 = require("appium/support");
|
|
|
5
5
|
const teen_process_1 = require("teen_process");
|
|
6
6
|
const appium_xcode_1 = require("appium-xcode");
|
|
7
7
|
require("@colors/colors");
|
|
8
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
9
8
|
class XcodeCheck {
|
|
9
|
+
log;
|
|
10
10
|
async diagnose() {
|
|
11
11
|
try {
|
|
12
12
|
const xcodePath = await (0, appium_xcode_1.getPath)();
|
|
@@ -28,17 +28,17 @@ class XcodeCheck {
|
|
|
28
28
|
}
|
|
29
29
|
exports.XcodeCheck = XcodeCheck;
|
|
30
30
|
exports.xcodeCheck = new XcodeCheck();
|
|
31
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
32
31
|
class XcodebuildCheck {
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
log;
|
|
33
|
+
static XCODE_VER_PATTERN = /^Xcode\s+([\d.]+)$/m;
|
|
34
|
+
static MIN_XCODE_VERSION = 13;
|
|
35
35
|
async diagnose() {
|
|
36
36
|
let xcodeVerMatch;
|
|
37
37
|
let stdout;
|
|
38
38
|
let stderr;
|
|
39
39
|
try {
|
|
40
40
|
({ stdout, stderr } = await (0, teen_process_1.exec)('xcodebuild', ['-version']));
|
|
41
|
-
xcodeVerMatch =
|
|
41
|
+
xcodeVerMatch = XcodebuildCheck.XCODE_VER_PATTERN.exec(stdout);
|
|
42
42
|
}
|
|
43
43
|
catch (err) {
|
|
44
44
|
return support_1.doctor.nok(`Cannot run 'xcodebuild': ${err.stderr || err.message}`);
|
|
@@ -47,15 +47,15 @@ class XcodebuildCheck {
|
|
|
47
47
|
return support_1.doctor.nok(`Cannot determine Xcode version. stdout: ${stdout}; stderr: ${stderr}`);
|
|
48
48
|
}
|
|
49
49
|
const xcodeMajorVer = parseInt(xcodeVerMatch[1], 10);
|
|
50
|
-
if (xcodeMajorVer <
|
|
50
|
+
if (xcodeMajorVer < XcodebuildCheck.MIN_XCODE_VERSION) {
|
|
51
51
|
return support_1.doctor.nok(`The actual Xcode version (${xcodeVerMatch[0]}) is older than the expected ` +
|
|
52
|
-
`one (${
|
|
52
|
+
`one (${XcodebuildCheck.MIN_XCODE_VERSION})`);
|
|
53
53
|
}
|
|
54
54
|
return support_1.doctor.ok(`xcodebuild is installed and has a matching version number ` +
|
|
55
|
-
`(${xcodeVerMatch[1]} >= ${
|
|
55
|
+
`(${xcodeVerMatch[1]} >= ${XcodebuildCheck.MIN_XCODE_VERSION})`);
|
|
56
56
|
}
|
|
57
57
|
async fix() {
|
|
58
|
-
return `Install ${'Xcode'.bold} ${
|
|
58
|
+
return `Install ${'Xcode'.bold} ${XcodebuildCheck.MIN_XCODE_VERSION}+ or upgrade the existing setup`;
|
|
59
59
|
}
|
|
60
60
|
hasAutofix() {
|
|
61
61
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-checks.js","sourceRoot":"","sources":["../../../lib/doctor/required-checks.
|
|
1
|
+
{"version":3,"file":"required-checks.js","sourceRoot":"","sources":["../../../lib/doctor/required-checks.ts"],"names":[],"mappings":";;;AAAA,4CAAsC;AACtC,+CAAkC;AAClC,+CAAuD;AAEvD,0BAAwB;AAGxB,MAAa,UAAU;IACrB,GAAG,CAAgB;IAEnB,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,IAAA,sBAAY,GAAE,CAAC;YACvC,OAAO,gBAAM,CAAC,EAAE,CAAC,0BAA0B,SAAS,GAAG,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,gBAAM,CAAC,GAAG,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,oBAAoB,OAAO,CAAC,IAAI,gFAAgF,CAAC;IAC1H,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvBD,gCAuBC;AACY,QAAA,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;AAG3C,MAAa,eAAe;IAC1B,GAAG,CAAgB;IACnB,MAAM,CAAU,iBAAiB,GAAG,qBAAqB,CAAC;IAC1D,MAAM,CAAU,iBAAiB,GAAG,EAAE,CAAC;IAEvC,KAAK,CAAC,QAAQ;QACZ,IAAI,aAAqC,CAAC;QAC1C,IAAI,MAAc,CAAC;QACnB,IAAI,MAAc,CAAC;QACnB,IAAI,CAAC;YACH,CAAC,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,YAAY,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC5D,aAAa,GAAG,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,gBAAM,CAAC,GAAG,CAAC,4BAA6B,GAAW,CAAC,MAAM,IAAK,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACjG,CAAC;QACD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,gBAAM,CAAC,GAAG,CAAC,2CAA2C,MAAM,aAAa,MAAM,EAAE,CAAC,CAAC;QAC5F,CAAC;QACD,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,aAAa,GAAG,eAAe,CAAC,iBAAiB,EAAE,CAAC;YACtD,OAAO,gBAAM,CAAC,GAAG,CAAC,6BAA6B,aAAa,CAAC,CAAC,CAAC,+BAA+B;gBAC5F,QAAQ,eAAe,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,gBAAM,CAAC,EAAE,CAAC,4DAA4D;YAC3E,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO,eAAe,CAAC,iBAAiB,GAAG,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,WAAW,OAAO,CAAC,IAAI,IAAI,eAAe,CAAC,iBAAiB,iCAAiC,CAAC;IACvG,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;;AArCH,0CAsCC;AACY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Return an executable path of cmd
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @return
|
|
4
|
+
* @param cmd Standard output by command
|
|
5
|
+
* @return The full path of cmd. `null` if the cmd is not found.
|
|
6
6
|
*/
|
|
7
|
-
export function resolveExecutablePath(cmd: string): Promise<string | null>;
|
|
7
|
+
export declare function resolveExecutablePath(cmd: string): Promise<string | null>;
|
|
8
8
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/doctor/utils.
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/doctor/utils.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ/E"}
|
|
@@ -5,8 +5,8 @@ const support_1 = require("appium/support");
|
|
|
5
5
|
/**
|
|
6
6
|
* Return an executable path of cmd
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @return
|
|
8
|
+
* @param cmd Standard output by command
|
|
9
|
+
* @return The full path of cmd. `null` if the cmd is not found.
|
|
10
10
|
*/
|
|
11
11
|
async function resolveExecutablePath(cmd) {
|
|
12
12
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/doctor/utils.
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/doctor/utils.ts"],"names":[],"mappings":";;AAQA,sDAQC;AAhBD,4CAAkC;AAElC;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,GAAW;IACrD,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,YAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,cAAc,IAAI,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;YACxD,OAAO,cAAc,CAAC;QACxB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/build/lib/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,GAAG,sCAAiC,CAAC;AAE3C,eAAe,GAAG,CAAC"}
|
package/build/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../lib/logger.
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../lib/logger.ts"],"names":[],"mappings":";;AAAA,4CAAwC;AAExC,MAAM,GAAG,GAAG,gBAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAE3C,kBAAe,GAAG,CAAC"}
|
package/build/lib/utils.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* parent process identifier
|
|
3
|
+
* Calculates the path to the current module's root folder
|
|
4
4
|
*
|
|
5
|
-
* @
|
|
6
|
-
* @
|
|
7
|
-
* or an empty list if none matched
|
|
5
|
+
* @returns The full path to module root
|
|
6
|
+
* @throws If the current module root folder cannot be determined
|
|
8
7
|
*/
|
|
9
|
-
export
|
|
8
|
+
export declare const getModuleRoot: (() => string) & _.MemoizedFunction;
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* Retrieves process ids of all the children processes created by the given
|
|
11
|
+
* parent process identifier
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
13
|
+
* @param parentPid parent process ID
|
|
14
|
+
* @returns the list of matched children process ids
|
|
15
|
+
* or an empty list if none matched
|
|
15
16
|
*/
|
|
16
|
-
export
|
|
17
|
-
import _ from 'lodash';
|
|
17
|
+
export declare function listChildrenProcessIds(parentPid: number | string): Promise<string[]>;
|
|
18
18
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAMvB;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAwC,MAAM,sBAMtE,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW3F"}
|
package/build/lib/utils.js
CHANGED
|
@@ -12,23 +12,22 @@ const MODULE_NAME = 'appium-mac2-driver';
|
|
|
12
12
|
/**
|
|
13
13
|
* Calculates the path to the current module's root folder
|
|
14
14
|
*
|
|
15
|
-
* @returns
|
|
16
|
-
* @throws
|
|
15
|
+
* @returns The full path to module root
|
|
16
|
+
* @throws If the current module root folder cannot be determined
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
exports.getModuleRoot = lodash_1.default.memoize(function getModuleRoot() {
|
|
19
19
|
const root = support_1.node.getModuleRootSync(MODULE_NAME, __filename);
|
|
20
20
|
if (!root) {
|
|
21
21
|
throw new Error(`Cannot find the root folder of the ${MODULE_NAME} Node.js module`);
|
|
22
22
|
}
|
|
23
23
|
return root;
|
|
24
24
|
});
|
|
25
|
-
exports.getModuleRoot = getModuleRoot;
|
|
26
25
|
/**
|
|
27
26
|
* Retrieves process ids of all the children processes created by the given
|
|
28
27
|
* parent process identifier
|
|
29
28
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @returns
|
|
29
|
+
* @param parentPid parent process ID
|
|
30
|
+
* @returns the list of matched children process ids
|
|
32
31
|
* or an empty list if none matched
|
|
33
32
|
*/
|
|
34
33
|
async function listChildrenProcessIds(parentPid) {
|
|
@@ -41,6 +40,6 @@ async function listChildrenProcessIds(parentPid) {
|
|
|
41
40
|
return [pid, lodash_1.default.last(rest)];
|
|
42
41
|
})
|
|
43
42
|
.filter(([, ppid]) => ppid === `${parentPid}`)
|
|
44
|
-
.map(([pid]) =>
|
|
43
|
+
.map(([pid]) => String(pid));
|
|
45
44
|
}
|
|
46
45
|
//# sourceMappingURL=utils.js.map
|
package/build/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":";;;;;;AA4BA,wDAWC;AAvCD,oDAAuB;AACvB,+CAAoC;AACpC,4CAAsC;AAEtC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEzC;;;;;GAKG;AACU,QAAA,aAAa,GAAG,gBAAC,CAAC,OAAO,CAAC,SAAS,aAAa;IAC3D,MAAM,IAAI,GAAG,cAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC7D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,sCAAsC,WAAW,iBAAiB,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACI,KAAK,UAAU,sBAAsB,CAAE,SAA0B;IACtE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,mBAAI,EAAC,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D,wEAAwE;IACxE,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;SACtB,MAAM,CAAC,gBAAC,CAAC,IAAI,CAAC;SACd,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE;QACpB,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,IAAI,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,EAAE,gBAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;SAC7C,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {resolveExecutablePath} from './utils';
|
|
2
|
+
import {doctor} from 'appium/support';
|
|
3
|
+
import {exec} from 'teen_process';
|
|
4
|
+
import type {IDoctorCheck, AppiumLogger, DoctorCheckResult} from '@appium/types';
|
|
5
|
+
import '@colors/colors';
|
|
6
|
+
|
|
7
|
+
export class OptionalFfmpegCheck implements IDoctorCheck {
|
|
8
|
+
log!: AppiumLogger;
|
|
9
|
+
static readonly FFMPEG_BINARY = 'ffmpeg';
|
|
10
|
+
static readonly FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
11
|
+
|
|
12
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
13
|
+
const ffmpegPath = await resolveExecutablePath(OptionalFfmpegCheck.FFMPEG_BINARY);
|
|
14
|
+
|
|
15
|
+
return ffmpegPath
|
|
16
|
+
? doctor.okOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
17
|
+
: doctor.nokOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} cannot be found`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async fix(): Promise<string> {
|
|
21
|
+
return (
|
|
22
|
+
`${`${OptionalFfmpegCheck.FFMPEG_BINARY}`.bold} is used to capture screen recordings. ` +
|
|
23
|
+
`Please read ${OptionalFfmpegCheck.FFMPEG_INSTALL_LINK}.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
hasAutofix(): boolean {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
isOptional(): boolean {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export class OptionalAutomationModeCheck implements IDoctorCheck {
|
|
39
|
+
log!: AppiumLogger;
|
|
40
|
+
|
|
41
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
42
|
+
let stdout: string;
|
|
43
|
+
try {
|
|
44
|
+
({stdout} = await exec('automationmodetool'));
|
|
45
|
+
} catch (err) {
|
|
46
|
+
return doctor.nokOptional(`Cannot run 'automationmodetool': ${(err as any).stderr || (err as Error).message}`);
|
|
47
|
+
}
|
|
48
|
+
if (stdout.includes('DOES NOT REQUIRE')) {
|
|
49
|
+
return doctor.okOptional(`Automation Mode does not require user authentication`);
|
|
50
|
+
}
|
|
51
|
+
return doctor.nokOptional(`Automation Mode requires user authentication`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async fix(): Promise<string> {
|
|
55
|
+
return `Run \`automationmodetool enable-automationmode-without-authentication\` to disable Automation Mode authentication`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
hasAutofix(): boolean {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
isOptional(): boolean {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export const optionalAutomationModeCheck = new OptionalAutomationModeCheck();
|
|
67
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {doctor} from 'appium/support';
|
|
2
|
+
import {exec} from 'teen_process';
|
|
3
|
+
import { getPath as getXcodePath } from 'appium-xcode';
|
|
4
|
+
import type {IDoctorCheck, AppiumLogger, DoctorCheckResult} from '@appium/types';
|
|
5
|
+
import '@colors/colors';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class XcodeCheck implements IDoctorCheck {
|
|
9
|
+
log!: AppiumLogger;
|
|
10
|
+
|
|
11
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
12
|
+
try {
|
|
13
|
+
const xcodePath = await getXcodePath();
|
|
14
|
+
return doctor.ok(`xCode is installed at '${xcodePath}'`);
|
|
15
|
+
} catch (err) {
|
|
16
|
+
return doctor.nok((err as Error).message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async fix(): Promise<string> {
|
|
21
|
+
return `Manually install ${'Xcode'.bold} and configure the active developer directory path using the xcode-select tool`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
hasAutofix(): boolean {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
isOptional(): boolean {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export const xcodeCheck = new XcodeCheck();
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export class XcodebuildCheck implements IDoctorCheck {
|
|
36
|
+
log!: AppiumLogger;
|
|
37
|
+
static readonly XCODE_VER_PATTERN = /^Xcode\s+([\d.]+)$/m;
|
|
38
|
+
static readonly MIN_XCODE_VERSION = 13;
|
|
39
|
+
|
|
40
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
41
|
+
let xcodeVerMatch: RegExpExecArray | null;
|
|
42
|
+
let stdout: string;
|
|
43
|
+
let stderr: string;
|
|
44
|
+
try {
|
|
45
|
+
({stdout, stderr} = await exec('xcodebuild', ['-version']));
|
|
46
|
+
xcodeVerMatch = XcodebuildCheck.XCODE_VER_PATTERN.exec(stdout);
|
|
47
|
+
} catch (err) {
|
|
48
|
+
return doctor.nok(`Cannot run 'xcodebuild': ${(err as any).stderr || (err as Error).message}`);
|
|
49
|
+
}
|
|
50
|
+
if (!xcodeVerMatch) {
|
|
51
|
+
return doctor.nok(`Cannot determine Xcode version. stdout: ${stdout}; stderr: ${stderr}`);
|
|
52
|
+
}
|
|
53
|
+
const xcodeMajorVer = parseInt(xcodeVerMatch[1], 10);
|
|
54
|
+
if (xcodeMajorVer < XcodebuildCheck.MIN_XCODE_VERSION) {
|
|
55
|
+
return doctor.nok(`The actual Xcode version (${xcodeVerMatch[0]}) is older than the expected ` +
|
|
56
|
+
`one (${XcodebuildCheck.MIN_XCODE_VERSION})`);
|
|
57
|
+
}
|
|
58
|
+
return doctor.ok(`xcodebuild is installed and has a matching version number ` +
|
|
59
|
+
`(${xcodeVerMatch[1]} >= ${XcodebuildCheck.MIN_XCODE_VERSION})`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async fix(): Promise<string> {
|
|
63
|
+
return `Install ${'Xcode'.bold} ${XcodebuildCheck.MIN_XCODE_VERSION}+ or upgrade the existing setup`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
hasAutofix(): boolean {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
isOptional(): boolean {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export const xcodebuildCheck = new XcodebuildCheck();
|
|
75
|
+
|
|
@@ -3,10 +3,10 @@ import {fs} from 'appium/support';
|
|
|
3
3
|
/**
|
|
4
4
|
* Return an executable path of cmd
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @return
|
|
6
|
+
* @param cmd Standard output by command
|
|
7
|
+
* @return The full path of cmd. `null` if the cmd is not found.
|
|
8
8
|
*/
|
|
9
|
-
export async function resolveExecutablePath(cmd) {
|
|
9
|
+
export async function resolveExecutablePath(cmd: string): Promise<string | null> {
|
|
10
10
|
try {
|
|
11
11
|
const executablePath = await fs.which(cmd);
|
|
12
12
|
if (executablePath && (await fs.exists(executablePath))) {
|
|
@@ -15,3 +15,4 @@ export async function resolveExecutablePath(cmd) {
|
|
|
15
15
|
} catch {}
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
+
|
|
@@ -7,10 +7,10 @@ const MODULE_NAME = 'appium-mac2-driver';
|
|
|
7
7
|
/**
|
|
8
8
|
* Calculates the path to the current module's root folder
|
|
9
9
|
*
|
|
10
|
-
* @returns
|
|
11
|
-
* @throws
|
|
10
|
+
* @returns The full path to module root
|
|
11
|
+
* @throws If the current module root folder cannot be determined
|
|
12
12
|
*/
|
|
13
|
-
const getModuleRoot = _.memoize(function getModuleRoot () {
|
|
13
|
+
export const getModuleRoot = _.memoize(function getModuleRoot (): string {
|
|
14
14
|
const root = node.getModuleRootSync(MODULE_NAME, __filename);
|
|
15
15
|
if (!root) {
|
|
16
16
|
throw new Error(`Cannot find the root folder of the ${MODULE_NAME} Node.js module`);
|
|
@@ -22,21 +22,19 @@ const getModuleRoot = _.memoize(function getModuleRoot () {
|
|
|
22
22
|
* Retrieves process ids of all the children processes created by the given
|
|
23
23
|
* parent process identifier
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
26
|
-
* @returns
|
|
25
|
+
* @param parentPid parent process ID
|
|
26
|
+
* @returns the list of matched children process ids
|
|
27
27
|
* or an empty list if none matched
|
|
28
28
|
*/
|
|
29
|
-
async function listChildrenProcessIds (parentPid) {
|
|
29
|
+
export async function listChildrenProcessIds (parentPid: number | string): Promise<string[]> {
|
|
30
30
|
const { stdout } = await exec('ps', ['axu', '-o', 'ppid']);
|
|
31
31
|
// USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND PPID
|
|
32
32
|
return stdout.split('\n')
|
|
33
33
|
.filter(_.trim)
|
|
34
|
-
.map((line) => {
|
|
34
|
+
.map((line: string) => {
|
|
35
35
|
const [, pid, ...rest] = line.split(/\s+/).filter(_.trim);
|
|
36
36
|
return [pid, _.last(rest)];
|
|
37
37
|
})
|
|
38
38
|
.filter(([, ppid]) => ppid === `${parentPid}`)
|
|
39
|
-
.map(([pid]) =>
|
|
39
|
+
.map(([pid]) => String(pid));
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
export { listChildrenProcessIds, getModuleRoot };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-mac2-driver",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-mac2-driver",
|
|
9
|
-
"version": "3.2.
|
|
9
|
+
"version": "3.2.3",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@appium/strongbox": "^1.0.0-rc.1",
|
|
@@ -1542,14 +1542,14 @@
|
|
|
1542
1542
|
}
|
|
1543
1543
|
},
|
|
1544
1544
|
"node_modules/color": {
|
|
1545
|
-
"version": "5.0.
|
|
1546
|
-
"resolved": "https://registry.npmjs.org/color/-/color-5.0.
|
|
1547
|
-
"integrity": "sha512-
|
|
1545
|
+
"version": "5.0.3",
|
|
1546
|
+
"resolved": "https://registry.npmjs.org/color/-/color-5.0.3.tgz",
|
|
1547
|
+
"integrity": "sha512-ezmVcLR3xAVp8kYOm4GS45ZLLgIE6SPAFoduLr6hTDajwb3KZ2F46gulK3XpcwRFb5KKGCSezCBAY4Dw4HsyXA==",
|
|
1548
1548
|
"extraneous": true,
|
|
1549
1549
|
"license": "MIT",
|
|
1550
1550
|
"dependencies": {
|
|
1551
|
-
"color-convert": "^3.
|
|
1552
|
-
"color-string": "^2.
|
|
1551
|
+
"color-convert": "^3.1.3",
|
|
1552
|
+
"color-string": "^2.1.3"
|
|
1553
1553
|
},
|
|
1554
1554
|
"engines": {
|
|
1555
1555
|
"node": ">=18"
|
|
@@ -1574,9 +1574,9 @@
|
|
|
1574
1574
|
"license": "MIT"
|
|
1575
1575
|
},
|
|
1576
1576
|
"node_modules/color-string": {
|
|
1577
|
-
"version": "2.1.
|
|
1578
|
-
"resolved": "https://registry.npmjs.org/color-string/-/color-string-2.1.
|
|
1579
|
-
"integrity": "sha512-
|
|
1577
|
+
"version": "2.1.3",
|
|
1578
|
+
"resolved": "https://registry.npmjs.org/color-string/-/color-string-2.1.3.tgz",
|
|
1579
|
+
"integrity": "sha512-r/wfcFshhORndnDjn3GtNVLA4QL4TAi0A/XIBNuWUIEAVyUBNWYLuckrDz/JM1aQlpIDzKuY5hAYdHcLYgwJsg==",
|
|
1580
1580
|
"extraneous": true,
|
|
1581
1581
|
"license": "MIT",
|
|
1582
1582
|
"dependencies": {
|
|
@@ -1597,9 +1597,9 @@
|
|
|
1597
1597
|
}
|
|
1598
1598
|
},
|
|
1599
1599
|
"node_modules/color/node_modules/color-convert": {
|
|
1600
|
-
"version": "3.1.
|
|
1601
|
-
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-3.1.
|
|
1602
|
-
"integrity": "sha512-
|
|
1600
|
+
"version": "3.1.3",
|
|
1601
|
+
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-3.1.3.tgz",
|
|
1602
|
+
"integrity": "sha512-fasDH2ont2GqF5HpyO4w0+BcewlhHEZOFn9c1ckZdHpJ56Qb7MHhH/IcJZbBGgvdtwdwNbLvxiBEdg336iA9Sg==",
|
|
1603
1603
|
"extraneous": true,
|
|
1604
1604
|
"license": "MIT",
|
|
1605
1605
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {resolveExecutablePath} from './utils';
|
|
2
|
-
import {doctor} from 'appium/support';
|
|
3
|
-
import {exec} from 'teen_process';
|
|
4
|
-
import '@colors/colors';
|
|
5
|
-
|
|
6
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
7
|
-
export class OptionalFfmpegCheck {
|
|
8
|
-
FFMPEG_BINARY = 'ffmpeg';
|
|
9
|
-
FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
10
|
-
|
|
11
|
-
async diagnose() {
|
|
12
|
-
const ffmpegPath = await resolveExecutablePath(this.FFMPEG_BINARY);
|
|
13
|
-
|
|
14
|
-
return ffmpegPath
|
|
15
|
-
? doctor.okOptional(`${this.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
16
|
-
: doctor.nokOptional(`${this.FFMPEG_BINARY} cannot be found`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async fix() {
|
|
20
|
-
return (
|
|
21
|
-
`${`${this.FFMPEG_BINARY}`.bold} is used to capture screen recordings. ` +
|
|
22
|
-
`Please read ${this.FFMPEG_INSTALL_LINK}.`
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
hasAutofix() {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
isOptional() {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
38
|
-
export class OptionalAutomationModeCheck {
|
|
39
|
-
async diagnose() {
|
|
40
|
-
let stdout;
|
|
41
|
-
try {
|
|
42
|
-
({stdout} = await exec('automationmodetool'));
|
|
43
|
-
} catch (err) {
|
|
44
|
-
return doctor.nokOptional(`Cannot run 'automationmodetool': ${err.stderr || err.message}`);
|
|
45
|
-
}
|
|
46
|
-
if (stdout.includes('DOES NOT REQUIRE')) {
|
|
47
|
-
return doctor.okOptional(`Automation Mode does not require user authentication`);
|
|
48
|
-
}
|
|
49
|
-
return doctor.nokOptional(`Automation Mode requires user authentication`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async fix() {
|
|
53
|
-
return `Run \`automationmodetool enable-automationmode-without-authentication\` to disable Automation Mode authentication`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
hasAutofix() {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
isOptional() {
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export const optionalAutomationModeCheck = new OptionalAutomationModeCheck();
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {doctor} from 'appium/support';
|
|
2
|
-
import {exec} from 'teen_process';
|
|
3
|
-
import { getPath as getXcodePath } from 'appium-xcode';
|
|
4
|
-
import '@colors/colors';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
8
|
-
export class XcodeCheck {
|
|
9
|
-
async diagnose() {
|
|
10
|
-
try {
|
|
11
|
-
const xcodePath = await getXcodePath();
|
|
12
|
-
return doctor.ok(`xCode is installed at '${xcodePath}'`);
|
|
13
|
-
} catch (err) {
|
|
14
|
-
return doctor.nok(err.message);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async fix() {
|
|
19
|
-
return `Manually install ${'Xcode'.bold} and configure the active developer directory path using the xcode-select tool`;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
hasAutofix() {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
isOptional() {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export const xcodeCheck = new XcodeCheck();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
34
|
-
export class XcodebuildCheck {
|
|
35
|
-
XCODE_VER_PATTERN = /^Xcode\s+([\d.]+)$/m;
|
|
36
|
-
MIN_XCODE_VERSION = 13;
|
|
37
|
-
|
|
38
|
-
async diagnose() {
|
|
39
|
-
let xcodeVerMatch;
|
|
40
|
-
let stdout;
|
|
41
|
-
let stderr;
|
|
42
|
-
try {
|
|
43
|
-
({stdout, stderr} = await exec('xcodebuild', ['-version']));
|
|
44
|
-
xcodeVerMatch = this.XCODE_VER_PATTERN.exec(stdout);
|
|
45
|
-
} catch (err) {
|
|
46
|
-
return doctor.nok(`Cannot run 'xcodebuild': ${err.stderr || err.message}`);
|
|
47
|
-
}
|
|
48
|
-
if (!xcodeVerMatch) {
|
|
49
|
-
return doctor.nok(`Cannot determine Xcode version. stdout: ${stdout}; stderr: ${stderr}`);
|
|
50
|
-
}
|
|
51
|
-
const xcodeMajorVer = parseInt(xcodeVerMatch[1], 10);
|
|
52
|
-
if (xcodeMajorVer < this.MIN_XCODE_VERSION) {
|
|
53
|
-
return doctor.nok(`The actual Xcode version (${xcodeVerMatch[0]}) is older than the expected ` +
|
|
54
|
-
`one (${this.MIN_XCODE_VERSION})`);
|
|
55
|
-
}
|
|
56
|
-
return doctor.ok(`xcodebuild is installed and has a matching version number ` +
|
|
57
|
-
`(${xcodeVerMatch[1]} >= ${this.MIN_XCODE_VERSION})`);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async fix() {
|
|
61
|
-
return `Install ${'Xcode'.bold} ${this.MIN_XCODE_VERSION}+ or upgrade the existing setup`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
hasAutofix() {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
isOptional() {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export const xcodebuildCheck = new XcodebuildCheck();
|