appium-xcuitest-driver 10.1.7 → 10.2.1
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/build/lib/doctor/checks.d.ts +2 -2
- package/build/lib/doctor/checks.d.ts.map +1 -1
- package/build/lib/doctor/checks.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts +33 -16
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +64 -15
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts +27 -38
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js +8 -24
- 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/lib/doctor/{checks.js → checks.ts} +1 -0
- package/lib/doctor/optional-checks.ts +173 -0
- package/lib/doctor/{required-checks.js → required-checks.ts} +41 -45
- package/lib/doctor/{utils.js → utils.ts} +4 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/lib/doctor/optional-checks.js +0 -93
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [10.2.1](https://github.com/appium/appium-xcuitest-driver/compare/v10.2.0...v10.2.1) (2025-10-10)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate doctor checks to typescript ([#2640](https://github.com/appium/appium-xcuitest-driver/issues/2640)) ([1bd49a7](https://github.com/appium/appium-xcuitest-driver/commit/1bd49a74a2e7789efd2cc52527b4559e9c91aa64))
|
|
6
|
+
|
|
7
|
+
## [10.2.0](https://github.com/appium/appium-xcuitest-driver/compare/v10.1.7...v10.2.0) (2025-10-10)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add optional simulator doctor check ([#2639](https://github.com/appium/appium-xcuitest-driver/issues/2639)) ([201d451](https://github.com/appium/appium-xcuitest-driver/commit/201d4519d051546dfd3b9f94f87e19a7914b7932))
|
|
12
|
+
|
|
1
13
|
## [10.1.7](https://github.com/appium/appium-xcuitest-driver/compare/v10.1.6...v10.1.7) (2025-10-10)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * as required from
|
|
2
|
-
export * as optional from
|
|
1
|
+
export * as required from './required-checks';
|
|
2
|
+
export * as optional from './optional-checks';
|
|
3
3
|
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/checks.
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../lib/doctor/checks.
|
|
1
|
+
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../lib/doctor/checks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA8C;AAC9C,8DAA8C"}
|
|
@@ -1,29 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { IDoctorCheck, AppiumLogger, DoctorCheckResult } from '@appium/types';
|
|
2
|
+
import '@colors/colors';
|
|
3
|
+
export declare class OptionalIdbCommandCheck implements IDoctorCheck {
|
|
4
|
+
log: AppiumLogger;
|
|
5
|
+
static readonly IDB_README_URL = "https://git.io/JnxQc";
|
|
6
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
5
7
|
fix(): Promise<string>;
|
|
6
8
|
hasAutofix(): boolean;
|
|
7
9
|
isOptional(): boolean;
|
|
8
10
|
}
|
|
9
|
-
export const optionalIdbCheck: OptionalIdbCommandCheck;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
diagnose(): Promise<
|
|
11
|
+
export declare const optionalIdbCheck: OptionalIdbCommandCheck;
|
|
12
|
+
export declare class OptionalSimulatorCheck implements IDoctorCheck {
|
|
13
|
+
log: AppiumLogger;
|
|
14
|
+
static readonly SUPPORTED_SIMULATOR_PLATFORMS: SimulatorPlatform[];
|
|
15
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
14
16
|
fix(): Promise<string>;
|
|
15
17
|
hasAutofix(): boolean;
|
|
16
18
|
isOptional(): boolean;
|
|
19
|
+
private _listInstalledSdks;
|
|
17
20
|
}
|
|
18
|
-
export const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
21
|
+
export declare const optionalSimulatorCheck: OptionalSimulatorCheck;
|
|
22
|
+
export declare class OptionalApplesimutilsCommandCheck implements IDoctorCheck {
|
|
23
|
+
log: AppiumLogger;
|
|
24
|
+
static readonly README_LINK = "https://github.com/appium/appium-xcuitest-driver/blob/master/docs/reference/execute-methods.md#mobile-setpermission";
|
|
25
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
24
26
|
fix(): Promise<string>;
|
|
25
27
|
hasAutofix(): boolean;
|
|
26
28
|
isOptional(): boolean;
|
|
27
29
|
}
|
|
28
|
-
export const
|
|
30
|
+
export declare const optionalApplesimutilsCheck: OptionalApplesimutilsCommandCheck;
|
|
31
|
+
export declare class OptionalFfmpegCheck implements IDoctorCheck {
|
|
32
|
+
log: AppiumLogger;
|
|
33
|
+
static readonly FFMPEG_BINARY = "ffmpeg";
|
|
34
|
+
static readonly FFMPEG_INSTALL_LINK = "https://www.ffmpeg.org/download.html";
|
|
35
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
36
|
+
fix(): Promise<string>;
|
|
37
|
+
hasAutofix(): boolean;
|
|
38
|
+
isOptional(): boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare const optionalFfmpegCheck: OptionalFfmpegCheck;
|
|
41
|
+
interface SimulatorPlatform {
|
|
42
|
+
displayName: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
29
46
|
//# 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":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,gBAAgB,CAAC;AAGxB,qBAAa,uBAAwB,YAAW,YAAY;IAC1D,GAAG,EAAG,YAAY,CAAC;IACnB,MAAM,CAAC,QAAQ,CAAC,cAAc,0BAA0B;IAElD,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAetC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,gBAAgB,yBAAgC,CAAC;AAE9D,qBAAa,sBAAuB,YAAW,YAAY;IACzD,GAAG,EAAG,YAAY,CAAC;IACnB,MAAM,CAAC,QAAQ,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,CAShE;IAEI,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IA0BtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;YAIP,kBAAkB;CAIjC;AACD,eAAO,MAAM,sBAAsB,wBAA+B,CAAC;AAEnE,qBAAa,iCAAkC,YAAW,YAAY;IACpE,GAAG,EAAG,YAAY,CAAC;IACnB,MAAM,CAAC,QAAQ,CAAC,WAAW,yHAAyH;IAE9I,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAOtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,0BAA0B,mCAA0C,CAAC;AAGlF,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;AAE7D,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optionalFfmpegCheck = exports.OptionalFfmpegCheck = exports.optionalApplesimutilsCheck = exports.OptionalApplesimutilsCommandCheck = exports.optionalIdbCheck = exports.OptionalIdbCommandCheck = void 0;
|
|
3
|
+
exports.optionalFfmpegCheck = exports.OptionalFfmpegCheck = exports.optionalApplesimutilsCheck = exports.OptionalApplesimutilsCommandCheck = exports.optionalSimulatorCheck = exports.OptionalSimulatorCheck = exports.optionalIdbCheck = exports.OptionalIdbCommandCheck = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
const support_1 = require("appium/support");
|
|
6
6
|
require("@colors/colors");
|
|
7
|
-
|
|
7
|
+
const teen_process_1 = require("teen_process");
|
|
8
8
|
class OptionalIdbCommandCheck {
|
|
9
|
-
|
|
9
|
+
log;
|
|
10
|
+
static IDB_README_URL = 'https://git.io/JnxQc';
|
|
10
11
|
async diagnose() {
|
|
11
12
|
const fbIdbPath = await (0, utils_1.resolveExecutablePath)('idb');
|
|
12
13
|
const fbCompanionIdbPath = await (0, utils_1.resolveExecutablePath)('idb_companion');
|
|
@@ -22,7 +23,7 @@ class OptionalIdbCommandCheck {
|
|
|
22
23
|
return support_1.doctor.nokOptional('idb and idb_companion are not installed');
|
|
23
24
|
}
|
|
24
25
|
async fix() {
|
|
25
|
-
return `Why ${'idb'.bold} is needed and how to install it: ${
|
|
26
|
+
return `Why ${'idb'.bold} is needed and how to install it: ${OptionalIdbCommandCheck.IDB_README_URL}`;
|
|
26
27
|
}
|
|
27
28
|
hasAutofix() {
|
|
28
29
|
return false;
|
|
@@ -33,9 +34,57 @@ class OptionalIdbCommandCheck {
|
|
|
33
34
|
}
|
|
34
35
|
exports.OptionalIdbCommandCheck = OptionalIdbCommandCheck;
|
|
35
36
|
exports.optionalIdbCheck = new OptionalIdbCommandCheck();
|
|
36
|
-
|
|
37
|
+
class OptionalSimulatorCheck {
|
|
38
|
+
log;
|
|
39
|
+
static SUPPORTED_SIMULATOR_PLATFORMS = [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'iOS',
|
|
42
|
+
name: 'iphonesimulator'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'tvOS',
|
|
46
|
+
name: 'appletvsimulator'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
async diagnose() {
|
|
50
|
+
try {
|
|
51
|
+
// https://github.com/appium/appium/issues/12093#issuecomment-459358120
|
|
52
|
+
await (0, teen_process_1.exec)('xcrun', ['simctl', 'help']);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
return support_1.doctor.nokOptional(`Testing on Simulator is not possible. Cannot run 'xcrun simctl': ${err.stderr || err.message}`);
|
|
56
|
+
}
|
|
57
|
+
const sdks = await this._listInstalledSdks();
|
|
58
|
+
for (const { displayName, name } of OptionalSimulatorCheck.SUPPORTED_SIMULATOR_PLATFORMS) {
|
|
59
|
+
const errorPrefix = `Testing on ${displayName} Simulator is not possible`;
|
|
60
|
+
if (!sdks.some(({ platform }) => platform === name)) {
|
|
61
|
+
return support_1.doctor.nokOptional(`${errorPrefix}: SDK is not installed`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return support_1.doctor.okOptional(`The following Simulator SDKs are installed:\n` +
|
|
65
|
+
sdks
|
|
66
|
+
.filter(({ platform }) => OptionalSimulatorCheck.SUPPORTED_SIMULATOR_PLATFORMS.some(({ name }) => name === platform))
|
|
67
|
+
.map(({ displayName }) => `\t→ ${displayName}`).join('\n'));
|
|
68
|
+
}
|
|
69
|
+
async fix() {
|
|
70
|
+
return `Install the desired Simulator SDK from Xcode's Settings -> Components`;
|
|
71
|
+
}
|
|
72
|
+
hasAutofix() {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
isOptional() {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
async _listInstalledSdks() {
|
|
79
|
+
const { stdout } = await (0, teen_process_1.exec)('xcodebuild', ['-json', '-showsdks']);
|
|
80
|
+
return JSON.parse(stdout);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.OptionalSimulatorCheck = OptionalSimulatorCheck;
|
|
84
|
+
exports.optionalSimulatorCheck = new OptionalSimulatorCheck();
|
|
37
85
|
class OptionalApplesimutilsCommandCheck {
|
|
38
|
-
|
|
86
|
+
log;
|
|
87
|
+
static README_LINK = 'https://github.com/appium/appium-xcuitest-driver/blob/master/docs/reference/execute-methods.md#mobile-setpermission';
|
|
39
88
|
async diagnose() {
|
|
40
89
|
const applesimutilsPath = await (0, utils_1.resolveExecutablePath)('applesimutils');
|
|
41
90
|
return applesimutilsPath
|
|
@@ -43,7 +92,7 @@ class OptionalApplesimutilsCommandCheck {
|
|
|
43
92
|
: support_1.doctor.nokOptional('applesimutils are not installed');
|
|
44
93
|
}
|
|
45
94
|
async fix() {
|
|
46
|
-
return `Why ${'applesimutils'.bold} is needed and how to install it: ${
|
|
95
|
+
return `Why ${'applesimutils'.bold} is needed and how to install it: ${OptionalApplesimutilsCommandCheck.README_LINK}`;
|
|
47
96
|
}
|
|
48
97
|
hasAutofix() {
|
|
49
98
|
return false;
|
|
@@ -54,19 +103,19 @@ class OptionalApplesimutilsCommandCheck {
|
|
|
54
103
|
}
|
|
55
104
|
exports.OptionalApplesimutilsCommandCheck = OptionalApplesimutilsCommandCheck;
|
|
56
105
|
exports.optionalApplesimutilsCheck = new OptionalApplesimutilsCommandCheck();
|
|
57
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
58
106
|
class OptionalFfmpegCheck {
|
|
59
|
-
|
|
60
|
-
|
|
107
|
+
log;
|
|
108
|
+
static FFMPEG_BINARY = 'ffmpeg';
|
|
109
|
+
static FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
61
110
|
async diagnose() {
|
|
62
|
-
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(
|
|
111
|
+
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(OptionalFfmpegCheck.FFMPEG_BINARY);
|
|
63
112
|
return ffmpegPath
|
|
64
|
-
? support_1.doctor.okOptional(`${
|
|
65
|
-
: support_1.doctor.nokOptional(`${
|
|
113
|
+
? support_1.doctor.okOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
114
|
+
: support_1.doctor.nokOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} cannot be found`);
|
|
66
115
|
}
|
|
67
116
|
async fix() {
|
|
68
|
-
return (`${`${
|
|
69
|
-
`Please read ${
|
|
117
|
+
return (`${`${OptionalFfmpegCheck.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
118
|
+
`Please read ${OptionalFfmpegCheck.FFMPEG_INSTALL_LINK}.`);
|
|
70
119
|
}
|
|
71
120
|
hasAutofix() {
|
|
72
121
|
return false;
|
|
@@ -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;AAEtC,0BAAwB;AACxB,+CAAkC;AAElC,MAAa,uBAAuB;IAClC,GAAG,CAAgB;IACnB,MAAM,CAAU,cAAc,GAAG,sBAAsB,CAAC;IAExD,KAAK,CAAC,QAAQ;QACZ,MAAM,SAAS,GAAG,MAAM,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC;QACrD,MAAM,kBAAkB,GAAG,MAAM,IAAA,6BAAqB,EAAC,eAAe,CAAC,CAAC;QACxE,IAAI,SAAS,IAAI,kBAAkB,EAAE,CAAC;YACpC,OAAO,gBAAM,CAAC,UAAU,CAAC,qCAAqC,CAAC,CAAC;QAClE,CAAC;QAED,IAAI,CAAC,SAAS,IAAI,kBAAkB,EAAE,CAAC;YACrC,OAAO,gBAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;QACpD,CAAC;aAAM,IAAI,SAAS,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5C,OAAO,gBAAM,CAAC,WAAW,CAAC,gCAAgC,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,gBAAM,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,OAAO,KAAK,CAAC,IAAI,qCAAqC,uBAAuB,CAAC,cAAc,EAAE,CAAC;IACxG,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAA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lF,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,oEAAoE;YAClH,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"}
|
|
@@ -1,53 +1,42 @@
|
|
|
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
|
-
diagnose(): Promise<
|
|
10
|
+
export declare const xcodeCheck: XcodeCheck;
|
|
11
|
+
export declare class XcodeToolsCheck implements IDoctorCheck {
|
|
12
|
+
log: AppiumLogger;
|
|
13
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
12
14
|
fix(): Promise<string>;
|
|
13
15
|
hasAutofix(): boolean;
|
|
14
16
|
isOptional(): boolean;
|
|
15
17
|
}
|
|
16
|
-
export const xcodeToolsCheck: XcodeToolsCheck;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
expectDir?: boolean | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* If set to true then
|
|
26
|
-
* the path is expected to be a valid file
|
|
27
|
-
*/
|
|
28
|
-
expectFile?: boolean | undefined;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* @typedef EnvVarCheckOptions
|
|
32
|
-
* @property {boolean} [expectDir] If set to true then
|
|
33
|
-
* the path is expected to be a valid folder
|
|
34
|
-
* @property {boolean} [expectFile] If set to true then
|
|
35
|
-
* the path is expected to be a valid file
|
|
36
|
-
*/
|
|
37
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
38
|
-
declare class EnvVarAndPathCheck {
|
|
39
|
-
/**
|
|
40
|
-
* @param {string} varName
|
|
41
|
-
* @param {EnvVarCheckOptions} [opts={}]
|
|
42
|
-
*/
|
|
18
|
+
export declare const xcodeToolsCheck: XcodeToolsCheck;
|
|
19
|
+
declare class EnvVarAndPathCheck implements IDoctorCheck {
|
|
20
|
+
private readonly varName;
|
|
21
|
+
private readonly opts;
|
|
22
|
+
log: AppiumLogger;
|
|
23
|
+
static readonly ENVIRONMENT_VARS_TUTORIAL_URL = "https://github.com/appium/java-client/blob/master/docs/environment.md";
|
|
43
24
|
constructor(varName: string, opts?: EnvVarCheckOptions);
|
|
44
|
-
|
|
45
|
-
varName: string;
|
|
46
|
-
opts: EnvVarCheckOptions;
|
|
47
|
-
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
25
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
48
26
|
fix(): Promise<string>;
|
|
49
27
|
hasAutofix(): boolean;
|
|
50
28
|
isOptional(): boolean;
|
|
51
29
|
}
|
|
30
|
+
export declare const homeEnvVarCheck: EnvVarAndPathCheck;
|
|
31
|
+
export interface EnvVarCheckOptions {
|
|
32
|
+
/**
|
|
33
|
+
* If set to true then the path is expected to be a valid folder
|
|
34
|
+
*/
|
|
35
|
+
expectDir?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* If set to true then the path is expected to be a valid file
|
|
38
|
+
*/
|
|
39
|
+
expectFile?: boolean;
|
|
40
|
+
}
|
|
52
41
|
export {};
|
|
53
42
|
//# 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;IAEb,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAUtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,eAAe,iBAAwB,CAAC;AAGrD,cAAM,kBAAmB,YAAW,YAAY;IAK5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IALvB,GAAG,EAAG,YAAY,CAAC;IACnB,MAAM,CAAC,QAAQ,CAAC,6BAA6B,2EAA2E;gBAGrG,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,kBAAuB;IAG1C,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAsBtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAO5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,eAAe,oBAAoD,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -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,10 @@ class XcodeCheck {
|
|
|
28
28
|
}
|
|
29
29
|
exports.XcodeCheck = XcodeCheck;
|
|
30
30
|
exports.xcodeCheck = new XcodeCheck();
|
|
31
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
32
31
|
class XcodeToolsCheck {
|
|
32
|
+
log;
|
|
33
33
|
async diagnose() {
|
|
34
34
|
const errPrefix = 'Xcode Command Line Tools are not installed or are improperly configured';
|
|
35
|
-
try {
|
|
36
|
-
// https://github.com/appium/appium/issues/12093#issuecomment-459358120
|
|
37
|
-
await (0, teen_process_1.exec)('xcrun', ['simctl', 'help']);
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
return support_1.doctor.nok(`${errPrefix}. Cannot run 'xcrun simctl': ${err.stderr || err.message}`);
|
|
41
|
-
}
|
|
42
35
|
try {
|
|
43
36
|
await (0, teen_process_1.exec)('xcodebuild', ['-version']);
|
|
44
37
|
}
|
|
@@ -59,20 +52,11 @@ class XcodeToolsCheck {
|
|
|
59
52
|
}
|
|
60
53
|
exports.XcodeToolsCheck = XcodeToolsCheck;
|
|
61
54
|
exports.xcodeToolsCheck = new XcodeToolsCheck();
|
|
62
|
-
/**
|
|
63
|
-
* @typedef EnvVarCheckOptions
|
|
64
|
-
* @property {boolean} [expectDir] If set to true then
|
|
65
|
-
* the path is expected to be a valid folder
|
|
66
|
-
* @property {boolean} [expectFile] If set to true then
|
|
67
|
-
* the path is expected to be a valid file
|
|
68
|
-
*/
|
|
69
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
70
55
|
class EnvVarAndPathCheck {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*/
|
|
56
|
+
varName;
|
|
57
|
+
opts;
|
|
58
|
+
log;
|
|
59
|
+
static ENVIRONMENT_VARS_TUTORIAL_URL = 'https://github.com/appium/java-client/blob/master/docs/environment.md';
|
|
76
60
|
constructor(varName, opts = {}) {
|
|
77
61
|
this.varName = varName;
|
|
78
62
|
this.opts = opts;
|
|
@@ -83,7 +67,7 @@ class EnvVarAndPathCheck {
|
|
|
83
67
|
return support_1.doctor.nok(`${this.varName} environment variable is NOT set!`);
|
|
84
68
|
}
|
|
85
69
|
if (!await support_1.fs.exists(varValue)) {
|
|
86
|
-
|
|
70
|
+
const errMsg = `${this.varName} is set to '${varValue}' but this path does not exist!`;
|
|
87
71
|
return support_1.doctor.nok(errMsg);
|
|
88
72
|
}
|
|
89
73
|
const stat = await support_1.fs.stat(varValue);
|
|
@@ -97,7 +81,7 @@ class EnvVarAndPathCheck {
|
|
|
97
81
|
}
|
|
98
82
|
async fix() {
|
|
99
83
|
return (`Make sure the environment variable ${this.varName.bold} is properly configured for the Appium process. ` +
|
|
100
|
-
`Refer ${
|
|
84
|
+
`Refer ${EnvVarAndPathCheck.ENVIRONMENT_VARS_TUTORIAL_URL} for more details.`);
|
|
101
85
|
}
|
|
102
86
|
hasAutofix() {
|
|
103
87
|
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,4CAA0C;AAC1C,+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,uDAAuD,CAAC;IACjE,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;IAEnB,KAAK,CAAC,QAAQ;QACZ,MAAM,SAAS,GAAG,yEAAyE,CAAC;QAC5F,IAAI,CAAC;YACH,MAAM,IAAA,mBAAI,EAAC,YAAY,EAAE,CA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IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/C,OAAO,gBAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,4DAA4D,CAAC,CAAC;QACjG,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/C,OAAO,gBAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,4DAA4D,CAAC,CAAC;QACjG,CAAC;QAED,OAAO,gBAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,eAAe,QAAQ,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CACL,sCAAsC,IAAI,CAAC,OAAO,CAAC,IAAI,kDAAkD;YACzG,SAAS,kBAAkB,CAAC,6BAA6B,oBAAoB,CAC9E,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;;AAEU,QAAA,eAAe,GAAG,IAAI,kBAAkB,CAAC,MAAM,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,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"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {resolveExecutablePath} from './utils';
|
|
2
|
+
import {doctor} from 'appium/support';
|
|
3
|
+
import type {IDoctorCheck, AppiumLogger, DoctorCheckResult} from '@appium/types';
|
|
4
|
+
import '@colors/colors';
|
|
5
|
+
import {exec} from 'teen_process';
|
|
6
|
+
|
|
7
|
+
export class OptionalIdbCommandCheck implements IDoctorCheck {
|
|
8
|
+
log!: AppiumLogger;
|
|
9
|
+
static readonly IDB_README_URL = 'https://git.io/JnxQc';
|
|
10
|
+
|
|
11
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
12
|
+
const fbIdbPath = await resolveExecutablePath('idb');
|
|
13
|
+
const fbCompanionIdbPath = await resolveExecutablePath('idb_companion');
|
|
14
|
+
if (fbIdbPath && fbCompanionIdbPath) {
|
|
15
|
+
return doctor.okOptional('idb and idb_companion are installed');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (!fbIdbPath && fbCompanionIdbPath) {
|
|
19
|
+
return doctor.nokOptional('idb is not installed');
|
|
20
|
+
} else if (fbIdbPath && !fbCompanionIdbPath) {
|
|
21
|
+
return doctor.nokOptional('idb_companion is not installed');
|
|
22
|
+
}
|
|
23
|
+
return doctor.nokOptional('idb and idb_companion are not installed');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async fix(): Promise<string> {
|
|
27
|
+
return `Why ${'idb'.bold} is needed and how to install it: ${OptionalIdbCommandCheck.IDB_README_URL}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
hasAutofix(): boolean {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
isOptional(): boolean {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export const optionalIdbCheck = new OptionalIdbCommandCheck();
|
|
39
|
+
|
|
40
|
+
export class OptionalSimulatorCheck implements IDoctorCheck {
|
|
41
|
+
log!: AppiumLogger;
|
|
42
|
+
static readonly SUPPORTED_SIMULATOR_PLATFORMS: SimulatorPlatform[] = [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'iOS',
|
|
45
|
+
name: 'iphonesimulator'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'tvOS',
|
|
49
|
+
name: 'appletvsimulator'
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
54
|
+
try {
|
|
55
|
+
// https://github.com/appium/appium/issues/12093#issuecomment-459358120
|
|
56
|
+
await exec('xcrun', ['simctl', 'help']);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
return doctor.nokOptional(
|
|
59
|
+
`Testing on Simulator is not possible. Cannot run 'xcrun simctl': ${(err as any).stderr || (err as Error).message}`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const sdks = await this._listInstalledSdks();
|
|
64
|
+
for (const {displayName, name} of OptionalSimulatorCheck.SUPPORTED_SIMULATOR_PLATFORMS) {
|
|
65
|
+
const errorPrefix = `Testing on ${displayName} Simulator is not possible`;
|
|
66
|
+
if (!sdks.some(({platform}) => platform === name)) {
|
|
67
|
+
return doctor.nokOptional(`${errorPrefix}: SDK is not installed`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return doctor.okOptional(
|
|
72
|
+
`The following Simulator SDKs are installed:\n` +
|
|
73
|
+
sdks
|
|
74
|
+
.filter(({platform}) => OptionalSimulatorCheck.SUPPORTED_SIMULATOR_PLATFORMS.some(({name}) => name === platform))
|
|
75
|
+
.map(({displayName}) => `\t→ ${displayName}`).join('\n')
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async fix(): Promise<string> {
|
|
80
|
+
return `Install the desired Simulator SDK from Xcode's Settings -> Components`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
hasAutofix(): boolean {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
isOptional(): boolean {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private async _listInstalledSdks(): Promise<InstalledSdk[]> {
|
|
92
|
+
const {stdout} = await exec('xcodebuild', ['-json', '-showsdks']);
|
|
93
|
+
return JSON.parse(stdout);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export const optionalSimulatorCheck = new OptionalSimulatorCheck();
|
|
97
|
+
|
|
98
|
+
export class OptionalApplesimutilsCommandCheck implements IDoctorCheck {
|
|
99
|
+
log!: AppiumLogger;
|
|
100
|
+
static readonly README_LINK = 'https://github.com/appium/appium-xcuitest-driver/blob/master/docs/reference/execute-methods.md#mobile-setpermission';
|
|
101
|
+
|
|
102
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
103
|
+
const applesimutilsPath = await resolveExecutablePath('applesimutils');
|
|
104
|
+
return applesimutilsPath
|
|
105
|
+
? doctor.okOptional(`applesimutils is installed at: ${applesimutilsPath}`)
|
|
106
|
+
: doctor.nokOptional('applesimutils are not installed');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async fix(): Promise<string> {
|
|
110
|
+
return `Why ${'applesimutils'.bold} is needed and how to install it: ${OptionalApplesimutilsCommandCheck.README_LINK}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
hasAutofix(): boolean {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
isOptional(): boolean {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export const optionalApplesimutilsCheck = new OptionalApplesimutilsCommandCheck();
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
export class OptionalFfmpegCheck implements IDoctorCheck {
|
|
125
|
+
log!: AppiumLogger;
|
|
126
|
+
static readonly FFMPEG_BINARY = 'ffmpeg';
|
|
127
|
+
static readonly FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
128
|
+
|
|
129
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
130
|
+
const ffmpegPath = await resolveExecutablePath(OptionalFfmpegCheck.FFMPEG_BINARY);
|
|
131
|
+
|
|
132
|
+
return ffmpegPath
|
|
133
|
+
? doctor.okOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
134
|
+
: doctor.nokOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} cannot be found`);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async fix(): Promise<string> {
|
|
138
|
+
return (
|
|
139
|
+
`${`${OptionalFfmpegCheck.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
140
|
+
`Please read ${OptionalFfmpegCheck.FFMPEG_INSTALL_LINK}.`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
hasAutofix(): boolean {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
isOptional(): boolean {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
153
|
+
|
|
154
|
+
interface SimulatorPlatform {
|
|
155
|
+
displayName: string;
|
|
156
|
+
name: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
interface InstalledSdk {
|
|
160
|
+
buildID?: string;
|
|
161
|
+
canonicalName: string;
|
|
162
|
+
displayName: string;
|
|
163
|
+
isBaseSdk: boolean;
|
|
164
|
+
platform: string;
|
|
165
|
+
platformPath: string;
|
|
166
|
+
platformVersion: string;
|
|
167
|
+
productBuildVersion?: string;
|
|
168
|
+
productCopyright?: string;
|
|
169
|
+
productName?: string;
|
|
170
|
+
productVersion?: string;
|
|
171
|
+
sdkPath: string;
|
|
172
|
+
sdkVersion: string;
|
|
173
|
+
}
|
|
@@ -1,97 +1,82 @@
|
|
|
1
1
|
import {fs, doctor} from 'appium/support';
|
|
2
2
|
import {exec} from 'teen_process';
|
|
3
3
|
import { getPath as getXcodePath } from 'appium-xcode';
|
|
4
|
+
import type {IDoctorCheck, AppiumLogger, DoctorCheckResult} from '@appium/types';
|
|
4
5
|
import '@colors/colors';
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export class XcodeCheck implements IDoctorCheck {
|
|
9
|
+
log!: AppiumLogger;
|
|
10
|
+
|
|
11
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
10
12
|
try {
|
|
11
13
|
const xcodePath = await getXcodePath();
|
|
12
14
|
return doctor.ok(`Xcode is installed at '${xcodePath}'`);
|
|
13
15
|
} catch (err) {
|
|
14
|
-
return doctor.nok(err.message);
|
|
16
|
+
return doctor.nok((err as Error).message);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
async fix() {
|
|
20
|
+
async fix(): Promise<string> {
|
|
19
21
|
return `Install Xcode and make sure it is properly configured`;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
hasAutofix() {
|
|
24
|
+
hasAutofix(): boolean {
|
|
23
25
|
return false;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
isOptional() {
|
|
28
|
+
isOptional(): boolean {
|
|
27
29
|
return false;
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
export const xcodeCheck = new XcodeCheck();
|
|
31
33
|
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
export class XcodeToolsCheck implements IDoctorCheck {
|
|
36
|
+
log!: AppiumLogger;
|
|
37
|
+
|
|
38
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
36
39
|
const errPrefix = 'Xcode Command Line Tools are not installed or are improperly configured';
|
|
37
|
-
try {
|
|
38
|
-
// https://github.com/appium/appium/issues/12093#issuecomment-459358120
|
|
39
|
-
await exec('xcrun', ['simctl', 'help']);
|
|
40
|
-
} catch (err) {
|
|
41
|
-
return doctor.nok(`${errPrefix}. Cannot run 'xcrun simctl': ${err.stderr || err.message}`);
|
|
42
|
-
}
|
|
43
40
|
try {
|
|
44
41
|
await exec('xcodebuild', ['-version']);
|
|
45
42
|
} catch (err) {
|
|
46
|
-
return doctor.nok(`${errPrefix}. Cannot run 'xcodebuild': ${err.stderr || err.message}`);
|
|
43
|
+
return doctor.nok(`${errPrefix}. Cannot run 'xcodebuild': ${(err as any).stderr || (err as Error).message}`);
|
|
47
44
|
}
|
|
48
45
|
return doctor.ok(`Xcode Command Line Tools are installed and work properly`);
|
|
49
46
|
}
|
|
50
47
|
|
|
51
|
-
async fix() {
|
|
48
|
+
async fix(): Promise<string> {
|
|
52
49
|
return `Make sure to install Xcode Command Line Tools by running 'xcode-select --install'`;
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
hasAutofix() {
|
|
52
|
+
hasAutofix(): boolean {
|
|
56
53
|
return false;
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
isOptional() {
|
|
56
|
+
isOptional(): boolean {
|
|
60
57
|
return false;
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
export const xcodeToolsCheck = new XcodeToolsCheck();
|
|
64
61
|
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* the path is expected to be a valid folder
|
|
70
|
-
* @property {boolean} [expectFile] If set to true then
|
|
71
|
-
* the path is expected to be a valid file
|
|
72
|
-
*/
|
|
63
|
+
class EnvVarAndPathCheck implements IDoctorCheck {
|
|
64
|
+
log!: AppiumLogger;
|
|
65
|
+
static readonly ENVIRONMENT_VARS_TUTORIAL_URL = 'https://github.com/appium/java-client/blob/master/docs/environment.md';
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
constructor(
|
|
68
|
+
private readonly varName: string,
|
|
69
|
+
private readonly opts: EnvVarCheckOptions = {}
|
|
70
|
+
) {}
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
* @param {string} varName
|
|
80
|
-
* @param {EnvVarCheckOptions} [opts={}]
|
|
81
|
-
*/
|
|
82
|
-
constructor(varName, opts = {}) {
|
|
83
|
-
this.varName = varName;
|
|
84
|
-
this.opts = opts;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async diagnose() {
|
|
72
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
88
73
|
const varValue = process.env[this.varName];
|
|
89
74
|
if (!varValue) {
|
|
90
75
|
return doctor.nok(`${this.varName} environment variable is NOT set!`);
|
|
91
76
|
}
|
|
92
77
|
|
|
93
78
|
if (!await fs.exists(varValue)) {
|
|
94
|
-
|
|
79
|
+
const errMsg = `${this.varName} is set to '${varValue}' but this path does not exist!`;
|
|
95
80
|
return doctor.nok(errMsg);
|
|
96
81
|
}
|
|
97
82
|
|
|
@@ -106,19 +91,30 @@ class EnvVarAndPathCheck {
|
|
|
106
91
|
return doctor.ok(`${this.varName} is set to: ${varValue}`);
|
|
107
92
|
}
|
|
108
93
|
|
|
109
|
-
async fix() {
|
|
94
|
+
async fix(): Promise<string> {
|
|
110
95
|
return (
|
|
111
96
|
`Make sure the environment variable ${this.varName.bold} is properly configured for the Appium process. ` +
|
|
112
|
-
`Refer ${
|
|
97
|
+
`Refer ${EnvVarAndPathCheck.ENVIRONMENT_VARS_TUTORIAL_URL} for more details.`
|
|
113
98
|
);
|
|
114
99
|
}
|
|
115
100
|
|
|
116
|
-
hasAutofix() {
|
|
101
|
+
hasAutofix(): boolean {
|
|
117
102
|
return false;
|
|
118
103
|
}
|
|
119
104
|
|
|
120
|
-
isOptional() {
|
|
105
|
+
isOptional(): boolean {
|
|
121
106
|
return false;
|
|
122
107
|
}
|
|
123
108
|
}
|
|
124
109
|
export const homeEnvVarCheck = new EnvVarAndPathCheck('HOME', {expectDir: true});
|
|
110
|
+
|
|
111
|
+
export interface EnvVarCheckOptions {
|
|
112
|
+
/**
|
|
113
|
+
* If set to true then the path is expected to be a valid folder
|
|
114
|
+
*/
|
|
115
|
+
expectDir?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* If set to true then the path is expected to be a valid file
|
|
118
|
+
*/
|
|
119
|
+
expectFile?: boolean;
|
|
120
|
+
}
|
|
@@ -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
|
+
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-xcuitest-driver",
|
|
3
|
-
"version": "10.1
|
|
3
|
+
"version": "10.2.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-xcuitest-driver",
|
|
9
|
-
"version": "10.1
|
|
9
|
+
"version": "10.2.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@appium/strongbox": "^1.0.0-rc.1",
|
package/package.json
CHANGED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import {resolveExecutablePath} from './utils';
|
|
2
|
-
import {doctor} from 'appium/support';
|
|
3
|
-
import '@colors/colors';
|
|
4
|
-
|
|
5
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
6
|
-
export class OptionalIdbCommandCheck {
|
|
7
|
-
IDB_README_URL = 'https://git.io/JnxQc';
|
|
8
|
-
|
|
9
|
-
async diagnose() {
|
|
10
|
-
const fbIdbPath = await resolveExecutablePath('idb');
|
|
11
|
-
const fbCompanionIdbPath = await resolveExecutablePath('idb_companion');
|
|
12
|
-
if (fbIdbPath && fbCompanionIdbPath) {
|
|
13
|
-
return doctor.okOptional('idb and idb_companion are installed');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (!fbIdbPath && fbCompanionIdbPath) {
|
|
17
|
-
return doctor.nokOptional('idb is not installed');
|
|
18
|
-
} else if (fbIdbPath && !fbCompanionIdbPath) {
|
|
19
|
-
return doctor.nokOptional('idb_companion is not installed');
|
|
20
|
-
}
|
|
21
|
-
return doctor.nokOptional('idb and idb_companion are not installed');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async fix() {
|
|
25
|
-
return `Why ${'idb'.bold} is needed and how to install it: ${this.IDB_README_URL}`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
hasAutofix() {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
isOptional() {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export const optionalIdbCheck = new OptionalIdbCommandCheck();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
40
|
-
export class OptionalApplesimutilsCommandCheck {
|
|
41
|
-
README_LINK = 'https://github.com/appium/appium-xcuitest-driver/blob/master/docs/reference/execute-methods.md#mobile-setpermission';
|
|
42
|
-
|
|
43
|
-
async diagnose() {
|
|
44
|
-
const applesimutilsPath = await resolveExecutablePath('applesimutils');
|
|
45
|
-
return applesimutilsPath
|
|
46
|
-
? doctor.okOptional(`applesimutils is installed at: ${applesimutilsPath}`)
|
|
47
|
-
: doctor.nokOptional('applesimutils are not installed');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async fix() {
|
|
51
|
-
return `Why ${'applesimutils'.bold} is needed and how to install it: ${this.README_LINK}`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
hasAutofix() {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
isOptional() {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export const optionalApplesimutilsCheck = new OptionalApplesimutilsCommandCheck();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
66
|
-
export class OptionalFfmpegCheck {
|
|
67
|
-
FFMPEG_BINARY = 'ffmpeg';
|
|
68
|
-
FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
69
|
-
|
|
70
|
-
async diagnose() {
|
|
71
|
-
const ffmpegPath = await resolveExecutablePath(this.FFMPEG_BINARY);
|
|
72
|
-
|
|
73
|
-
return ffmpegPath
|
|
74
|
-
? doctor.okOptional(`${this.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
75
|
-
: doctor.nokOptional(`${this.FFMPEG_BINARY} cannot be found`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async fix() {
|
|
79
|
-
return (
|
|
80
|
-
`${`${this.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
81
|
-
`Please read ${this.FFMPEG_INSTALL_LINK}.`
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
hasAutofix() {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
isOptional() {
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|