appium-android-driver 7.4.1 → 7.5.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 +14 -0
- package/build/lib/doctor/checks.d.ts +83 -0
- package/build/lib/doctor/checks.d.ts.map +1 -0
- package/build/lib/doctor/checks.js +211 -0
- package/build/lib/doctor/checks.js.map +1 -0
- package/build/lib/doctor/utils.d.ts +8 -0
- package/build/lib/doctor/utils.d.ts.map +1 -0
- package/build/lib/doctor/utils.js +22 -0
- package/build/lib/doctor/utils.js.map +1 -0
- package/build/lib/index.d.ts +1 -0
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +14 -1
- package/build/lib/index.js.map +1 -1
- package/lib/doctor/checks.js +253 -0
- package/lib/doctor/utils.js +17 -0
- package/lib/index.ts +1 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [7.5.1](https://github.com/appium/appium-android-driver/compare/v7.5.0...v7.5.1) (2024-01-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Use built-in logger for doctor checks ([#893](https://github.com/appium/appium-android-driver/issues/893)) ([5fb33ad](https://github.com/appium/appium-android-driver/commit/5fb33adc600339fb7fa7e951c7069a8518128cd3))
|
|
7
|
+
|
|
8
|
+
## [7.5.0](https://github.com/appium/appium-android-driver/compare/v7.4.1...v7.5.0) (2024-01-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Add common android doctor checks ([#892](https://github.com/appium/appium-android-driver/issues/892)) ([4d1d648](https://github.com/appium/appium-android-driver/commit/4d1d6480f610bfe7680c325caef36fbd0edc8b20))
|
|
14
|
+
|
|
1
15
|
## [7.4.1](https://github.com/appium/appium-android-driver/compare/v7.4.0...v7.4.1) (2023-12-18)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const androidHomeCheck: EnvVarAndPathCheck;
|
|
2
|
+
export const javaHomeCheck: EnvVarAndPathCheck;
|
|
3
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
4
|
+
export class JavaHomeValueCheck {
|
|
5
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
6
|
+
fix(): Promise<string>;
|
|
7
|
+
hasAutofix(): boolean;
|
|
8
|
+
isOptional(): boolean;
|
|
9
|
+
}
|
|
10
|
+
export const javaHomeValueCheck: JavaHomeValueCheck;
|
|
11
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
12
|
+
export class AndroidSdkCheck {
|
|
13
|
+
/** @type {import('@appium/types').AppiumLogger} */
|
|
14
|
+
log: import('@appium/types').AppiumLogger;
|
|
15
|
+
TOOL_NAMES: string[];
|
|
16
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
17
|
+
fix(): Promise<string>;
|
|
18
|
+
hasAutofix(): boolean;
|
|
19
|
+
isOptional(): boolean;
|
|
20
|
+
}
|
|
21
|
+
export const androidSdkCheck: AndroidSdkCheck;
|
|
22
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
23
|
+
export class OptionalBundletoolCheck {
|
|
24
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
25
|
+
fix(): Promise<string>;
|
|
26
|
+
hasAutofix(): boolean;
|
|
27
|
+
isOptional(): boolean;
|
|
28
|
+
}
|
|
29
|
+
export const optionalBundletoolCheck: OptionalBundletoolCheck;
|
|
30
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
31
|
+
export class OptionalGstreamerCheck {
|
|
32
|
+
GSTREAMER_BINARY: string;
|
|
33
|
+
GST_INSPECT_BINARY: string;
|
|
34
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
35
|
+
fix(): Promise<string>;
|
|
36
|
+
hasAutofix(): boolean;
|
|
37
|
+
isOptional(): boolean;
|
|
38
|
+
}
|
|
39
|
+
export const optionalGstreamerCheck: OptionalGstreamerCheck;
|
|
40
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
41
|
+
export class OptionalFfmpegCheck {
|
|
42
|
+
FFMPEG_BINARY: string;
|
|
43
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
44
|
+
fix(): Promise<string>;
|
|
45
|
+
hasAutofix(): boolean;
|
|
46
|
+
isOptional(): boolean;
|
|
47
|
+
}
|
|
48
|
+
export const optionalFfmpegCheck: OptionalFfmpegCheck;
|
|
49
|
+
export type EnvVarCheckOptions = {
|
|
50
|
+
/**
|
|
51
|
+
* If set to true then
|
|
52
|
+
* the path is expected to be a valid folder
|
|
53
|
+
*/
|
|
54
|
+
expectDir?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* If set to true then
|
|
57
|
+
* the path is expected to be a valid file
|
|
58
|
+
*/
|
|
59
|
+
expectFile?: boolean | undefined;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @typedef EnvVarCheckOptions
|
|
63
|
+
* @property {boolean} [expectDir] If set to true then
|
|
64
|
+
* the path is expected to be a valid folder
|
|
65
|
+
* @property {boolean} [expectFile] If set to true then
|
|
66
|
+
* the path is expected to be a valid file
|
|
67
|
+
*/
|
|
68
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
69
|
+
declare class EnvVarAndPathCheck {
|
|
70
|
+
/**
|
|
71
|
+
* @param {string} varName
|
|
72
|
+
* @param {EnvVarCheckOptions} [opts={}]
|
|
73
|
+
*/
|
|
74
|
+
constructor(varName: string, opts?: EnvVarCheckOptions | undefined);
|
|
75
|
+
varName: string;
|
|
76
|
+
opts: EnvVarCheckOptions;
|
|
77
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
78
|
+
fix(): Promise<string>;
|
|
79
|
+
hasAutofix(): boolean;
|
|
80
|
+
isOptional(): boolean;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/checks.js"],"names":[],"mappings":"AA2EA,kDAA0F;AAC1F,+CAAoF;AAEpF,wDAAwD;AACxD;IACE,+DAeC;IAED,uBAGC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,oDAA2D;AAE3D,wDAAwD;AACxD;IACE,mDAAmD;IACnD,KADW,OAAO,eAAe,EAAE,YAAY,CAC3C;IAEJ,qBAAmF;IAEnF,+DAwBC;IAED,uBAKC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,8CAAqD;AAErD,wDAAwD;AACxD;IACE,+DAKC;IAED,uBAOC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,8DAAqE;AAErE,wDAAwD;AACxD;IACE,yBAAuE;IACvE,2BAA0E;IAE1E,+DASC;IAED,uBAOC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,4DAAmE;AAEnE,wDAAwD;AACxD;IACE,sBAA4D;IAE5D,+DAMC;IAED,uBAKC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,sDAA6D;;;;;;;;;;;;;AA5O7D;;;;;;GAMG;AAEH,wDAAwD;AACxD;IACE;;;OAGG;IACH,qBAHW,MAAM,yCAMhB;IAFC,gBAAsB;IACtB,yBAAgB;IAGlB,+DAuBC;IAED,uBAKC;IAED,sBAEC;IAED,sBAEC;CACF"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.optionalFfmpegCheck = exports.OptionalFfmpegCheck = exports.optionalGstreamerCheck = exports.OptionalGstreamerCheck = exports.optionalBundletoolCheck = exports.OptionalBundletoolCheck = exports.androidSdkCheck = exports.AndroidSdkCheck = exports.javaHomeValueCheck = exports.JavaHomeValueCheck = exports.javaHomeCheck = exports.androidHomeCheck = void 0;
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const support_1 = require("@appium/support");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
require("@colors/colors");
|
|
11
|
+
const appium_adb_1 = require("appium-adb");
|
|
12
|
+
const JAVA_HOME_VAR_NAME = support_1.system.isWindows() ? '%JAVA_HOME%' : '$JAVA_HOME';
|
|
13
|
+
const ENVIRONMENT_VARS_TUTORIAL_URL = 'https://github.com/appium/java-client/blob/master/docs/environment.md';
|
|
14
|
+
const JAVA_HOME_TUTORIAL = 'https://docs.oracle.com/cd/E21454_01/html/821-2531/inst_jdk_javahome_t.html';
|
|
15
|
+
const ANDROID_SDK_LINK1 = 'https://developer.android.com/studio#cmdline-tools';
|
|
16
|
+
const ANDROID_SDK_LINK2 = 'https://developer.android.com/studio/intro/update#sdk-manager';
|
|
17
|
+
const BUNDLETOOL_RELEASES_LINK = 'https://github.com/google/bundletool/releases/';
|
|
18
|
+
const GSTREAMER_INSTALL_LINK = 'https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c';
|
|
19
|
+
const FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
20
|
+
/**
|
|
21
|
+
* @typedef EnvVarCheckOptions
|
|
22
|
+
* @property {boolean} [expectDir] If set to true then
|
|
23
|
+
* the path is expected to be a valid folder
|
|
24
|
+
* @property {boolean} [expectFile] If set to true then
|
|
25
|
+
* the path is expected to be a valid file
|
|
26
|
+
*/
|
|
27
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
28
|
+
class EnvVarAndPathCheck {
|
|
29
|
+
/**
|
|
30
|
+
* @param {string} varName
|
|
31
|
+
* @param {EnvVarCheckOptions} [opts={}]
|
|
32
|
+
*/
|
|
33
|
+
constructor(varName, opts = {}) {
|
|
34
|
+
this.varName = varName;
|
|
35
|
+
this.opts = opts;
|
|
36
|
+
}
|
|
37
|
+
async diagnose() {
|
|
38
|
+
const varValue = process.env[this.varName];
|
|
39
|
+
if (!varValue) {
|
|
40
|
+
return support_1.doctor.nok(`${this.varName} environment variable is NOT set!`);
|
|
41
|
+
}
|
|
42
|
+
if (!await support_1.fs.exists(varValue)) {
|
|
43
|
+
let errMsg = `${this.varName} is set to '${varValue}' but this path does not exist!`;
|
|
44
|
+
if (support_1.system.isWindows() && varValue.includes('%')) {
|
|
45
|
+
errMsg += ` Consider replacing all references to other environment variables with absolute paths.`;
|
|
46
|
+
}
|
|
47
|
+
return support_1.doctor.nok(errMsg);
|
|
48
|
+
}
|
|
49
|
+
const stat = await support_1.fs.stat(varValue);
|
|
50
|
+
if (this.opts.expectDir && !stat.isDirectory()) {
|
|
51
|
+
return support_1.doctor.nok(`${this.varName} is expected to be a valid folder, got a file path instead`);
|
|
52
|
+
}
|
|
53
|
+
if (this.opts.expectFile && stat.isDirectory()) {
|
|
54
|
+
return support_1.doctor.nok(`${this.varName} is expected to be a valid file, got a folder path instead`);
|
|
55
|
+
}
|
|
56
|
+
return support_1.doctor.ok(`${this.varName} is set to: ${varValue}`);
|
|
57
|
+
}
|
|
58
|
+
async fix() {
|
|
59
|
+
return (`Make sure the environment variable ${this.varName.bold} is properly configured for the Appium process. ` +
|
|
60
|
+
`Refer ${ENVIRONMENT_VARS_TUTORIAL_URL} for more details.`);
|
|
61
|
+
}
|
|
62
|
+
hasAutofix() {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
isOptional() {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.androidHomeCheck = new EnvVarAndPathCheck('ANDROID_HOME', { expectDir: true });
|
|
70
|
+
exports.javaHomeCheck = new EnvVarAndPathCheck('JAVA_HOME', { expectDir: true });
|
|
71
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
72
|
+
class JavaHomeValueCheck {
|
|
73
|
+
async diagnose() {
|
|
74
|
+
const envVar = process.env.JAVA_HOME;
|
|
75
|
+
if (!envVar) {
|
|
76
|
+
return support_1.doctor.nok(`${JAVA_HOME_VAR_NAME} environment variable must be set`);
|
|
77
|
+
}
|
|
78
|
+
const javaBinaryRelativePath = path_1.default.join('bin', `java${support_1.system.isWindows() ? '.exe' : ''}`);
|
|
79
|
+
const javaBinary = path_1.default.join(envVar, javaBinaryRelativePath);
|
|
80
|
+
if (!await support_1.fs.exists(javaBinary)) {
|
|
81
|
+
return support_1.doctor.nok(`${JAVA_HOME_VAR_NAME} is set to an invalid value. ` +
|
|
82
|
+
`It must be pointing to a folder containing ${javaBinaryRelativePath}`);
|
|
83
|
+
}
|
|
84
|
+
return support_1.doctor.ok(`'${javaBinaryRelativePath}' exists under '${envVar}'`);
|
|
85
|
+
}
|
|
86
|
+
async fix() {
|
|
87
|
+
return `Set ${JAVA_HOME_VAR_NAME} environment variable to the root folder path of your local JDK installation. ` +
|
|
88
|
+
`Read ${JAVA_HOME_TUTORIAL}`;
|
|
89
|
+
}
|
|
90
|
+
hasAutofix() {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
isOptional() {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.JavaHomeValueCheck = JavaHomeValueCheck;
|
|
98
|
+
exports.javaHomeValueCheck = new JavaHomeValueCheck();
|
|
99
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
100
|
+
class AndroidSdkCheck {
|
|
101
|
+
constructor() {
|
|
102
|
+
this.TOOL_NAMES = ['adb', 'emulator', `apkanalyzer${support_1.system.isWindows() ? '.bat' : ''}`];
|
|
103
|
+
}
|
|
104
|
+
async diagnose() {
|
|
105
|
+
const listOfTools = this.TOOL_NAMES.join(', ');
|
|
106
|
+
const sdkRoot = (0, appium_adb_1.getSdkRootFromEnv)();
|
|
107
|
+
if (!sdkRoot) {
|
|
108
|
+
return support_1.doctor.nok(`${listOfTools} could not be found because ANDROID_HOME is NOT set!`);
|
|
109
|
+
}
|
|
110
|
+
this.log.info(` Checking ${listOfTools}`);
|
|
111
|
+
const missingBinaries = [];
|
|
112
|
+
for (const binary of this.TOOL_NAMES) {
|
|
113
|
+
try {
|
|
114
|
+
this.log.info(` '${binary}' exists in ${await (0, appium_adb_1.getAndroidBinaryPath)(binary)}`);
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
missingBinaries.push(binary);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (missingBinaries.length > 0) {
|
|
121
|
+
return support_1.doctor.nok(`${missingBinaries.join(', ')} could NOT be found in '${sdkRoot}'!`);
|
|
122
|
+
}
|
|
123
|
+
return support_1.doctor.ok(`${listOfTools} exist in '${sdkRoot}'`);
|
|
124
|
+
}
|
|
125
|
+
async fix() {
|
|
126
|
+
return (`Manually install ${'Android SDK'.bold} and set ${'ANDROID_HOME'.bold}. ` +
|
|
127
|
+
`Read ${[ANDROID_SDK_LINK1, ANDROID_SDK_LINK2].join(' and ')}.`);
|
|
128
|
+
}
|
|
129
|
+
hasAutofix() {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
isOptional() {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.AndroidSdkCheck = AndroidSdkCheck;
|
|
137
|
+
exports.androidSdkCheck = new AndroidSdkCheck();
|
|
138
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
139
|
+
class OptionalBundletoolCheck {
|
|
140
|
+
async diagnose() {
|
|
141
|
+
const bundletoolPath = await (0, utils_1.resolveExecutablePath)('bundletool.jar');
|
|
142
|
+
return bundletoolPath
|
|
143
|
+
? support_1.doctor.okOptional(`bundletool.jar is installed at: ${bundletoolPath}`)
|
|
144
|
+
: support_1.doctor.nokOptional('bundletool.jar cannot be found');
|
|
145
|
+
}
|
|
146
|
+
async fix() {
|
|
147
|
+
return (`${'bundletool.jar'.bold} is used to handle Android App bundles. ` +
|
|
148
|
+
`Please download the binary from ${BUNDLETOOL_RELEASES_LINK} and store it ` +
|
|
149
|
+
`to any folder listed in the PATH environment variable. Folders that ` +
|
|
150
|
+
`are currently present in PATH: ${process.env.PATH}`);
|
|
151
|
+
}
|
|
152
|
+
hasAutofix() {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
isOptional() {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.OptionalBundletoolCheck = OptionalBundletoolCheck;
|
|
160
|
+
exports.optionalBundletoolCheck = new OptionalBundletoolCheck();
|
|
161
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
162
|
+
class OptionalGstreamerCheck {
|
|
163
|
+
constructor() {
|
|
164
|
+
this.GSTREAMER_BINARY = `gst-launch-1.0${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
165
|
+
this.GST_INSPECT_BINARY = `gst-inspect-1.0${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
166
|
+
}
|
|
167
|
+
async diagnose() {
|
|
168
|
+
const gstreamerPath = await (0, utils_1.resolveExecutablePath)(this.GSTREAMER_BINARY);
|
|
169
|
+
const gstInspectPath = await (0, utils_1.resolveExecutablePath)(this.GST_INSPECT_BINARY);
|
|
170
|
+
return gstreamerPath && gstInspectPath
|
|
171
|
+
? support_1.doctor.okOptional(`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY} are installed at: ${gstreamerPath} and ${gstInspectPath}`)
|
|
172
|
+
: support_1.doctor.nokOptional(`${this.GSTREAMER_BINARY} and/or ${this.GST_INSPECT_BINARY} cannot be found`);
|
|
173
|
+
}
|
|
174
|
+
async fix() {
|
|
175
|
+
return (`${`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY}`.bold} are used to stream the screen of the device under test. ` +
|
|
176
|
+
`Please read ${GSTREAMER_INSTALL_LINK}.`);
|
|
177
|
+
}
|
|
178
|
+
hasAutofix() {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
isOptional() {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.OptionalGstreamerCheck = OptionalGstreamerCheck;
|
|
186
|
+
exports.optionalGstreamerCheck = new OptionalGstreamerCheck();
|
|
187
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
188
|
+
class OptionalFfmpegCheck {
|
|
189
|
+
constructor() {
|
|
190
|
+
this.FFMPEG_BINARY = `ffmpeg${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
191
|
+
}
|
|
192
|
+
async diagnose() {
|
|
193
|
+
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(this.FFMPEG_BINARY);
|
|
194
|
+
return ffmpegPath
|
|
195
|
+
? support_1.doctor.okOptional(`${this.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
196
|
+
: support_1.doctor.nokOptional(`${this.FFMPEG_BINARY} cannot be found`);
|
|
197
|
+
}
|
|
198
|
+
async fix() {
|
|
199
|
+
return (`${`${this.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
200
|
+
`Please read ${FFMPEG_INSTALL_LINK}.`);
|
|
201
|
+
}
|
|
202
|
+
hasAutofix() {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
isOptional() {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
exports.OptionalFfmpegCheck = OptionalFfmpegCheck;
|
|
210
|
+
exports.optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
211
|
+
//# sourceMappingURL=checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../lib/doctor/checks.js"],"names":[],"mappings":";;;;;;AAAA,mCAA8C;AAC9C,6CAAmD;AACnD,gDAAwB;AACxB,0BAAwB;AACxB,2CAAmE;AAGnE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J,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/BD,wDA+BC;AACY,QAAA,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC;AAEnE,wDAAwD;AACxD,MAAa,mBAAmB;IAAhC;QACE,kBAAa,GAAG,SAAS,gBAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAwB9D,CAAC;IAtBC,KAAK,CAAC,QAAQ;QACZ,MAAM,UAAU,GAAG,MAAM,IAAA,6BAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEnE,OAAO,UAAU;YACf,CAAC,CAAC,gBAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,aAAa,eAAe,UAAU,GAAG,CAAC;YACtE,CAAC,CAAC,gBAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,aAAa,kBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CACL,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,oEAAoE;YACnG,eAAe,mBAAmB,GAAG,CACtC,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzBD,kDAyBC;AACY,QAAA,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return an executable path of cmd
|
|
3
|
+
*
|
|
4
|
+
* @param {string} cmd Standard output by command
|
|
5
|
+
* @return {Promise<string?>} The full path of cmd. `null` if the cmd is not found.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveExecutablePath(cmd: string): Promise<string | null>;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/doctor/utils.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,2CAHW,MAAM,GACL,QAAQ,MAAM,QAAE,CAU3B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveExecutablePath = void 0;
|
|
4
|
+
const support_1 = require("@appium/support");
|
|
5
|
+
/**
|
|
6
|
+
* Return an executable path of cmd
|
|
7
|
+
*
|
|
8
|
+
* @param {string} cmd Standard output by command
|
|
9
|
+
* @return {Promise<string?>} The full path of cmd. `null` if the cmd is not found.
|
|
10
|
+
*/
|
|
11
|
+
async function resolveExecutablePath(cmd) {
|
|
12
|
+
try {
|
|
13
|
+
const executablePath = await support_1.fs.which(cmd);
|
|
14
|
+
if (executablePath && (await support_1.fs.exists(executablePath))) {
|
|
15
|
+
return executablePath;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch (err) { }
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
exports.resolveExecutablePath = resolveExecutablePath;
|
|
22
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/doctor/utils.js"],"names":[],"mappings":";;;AAAA,6CAAmC;AAEnC;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,GAAG;IAC7C,IAAI;QACF,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;YACvD,OAAO,cAAc,CAAC;SACvB;KACF;IAAC,OAAO,GAAG,EAAE,GAAE;IAChB,OAAO,IAAI,CAAC;AACd,CAAC;AARD,sDAQC"}
|
package/build/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AndroidDriver } from './driver';
|
|
|
2
2
|
export type * from './commands';
|
|
3
3
|
export { ANDROID_DRIVER_CONSTRAINTS as commonCapConstraints } from './constraints';
|
|
4
4
|
export * from './driver';
|
|
5
|
+
export * as doctor from './doctor/checks';
|
|
5
6
|
export { SETTINGS_HELPER_PKG_ID, default as androidHelpers } from './helpers/android';
|
|
6
7
|
export type * from './helpers/types';
|
|
7
8
|
export { CHROMIUM_WIN, NATIVE_WIN, WEBVIEW_BASE, WEBVIEW_WIN, default as webviewHelpers, } from './helpers/webview';
|
package/build/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAC,0BAA0B,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACjF,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,sBAAsB,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACpF,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,IAAI,cAAc,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,eAAe,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAC,0BAA0B,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACjF,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,sBAAsB,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACpF,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,IAAI,cAAc,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,eAAe,aAAa,CAAC"}
|
package/build/lib/index.js
CHANGED
|
@@ -10,20 +10,33 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
16
28
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
30
|
};
|
|
19
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.webviewHelpers = exports.WEBVIEW_WIN = exports.WEBVIEW_BASE = exports.NATIVE_WIN = exports.CHROMIUM_WIN = exports.androidHelpers = exports.SETTINGS_HELPER_PKG_ID = exports.commonCapConstraints = void 0;
|
|
32
|
+
exports.webviewHelpers = exports.WEBVIEW_WIN = exports.WEBVIEW_BASE = exports.NATIVE_WIN = exports.CHROMIUM_WIN = exports.androidHelpers = exports.SETTINGS_HELPER_PKG_ID = exports.doctor = exports.commonCapConstraints = void 0;
|
|
21
33
|
const source_map_support_1 = require("source-map-support");
|
|
22
34
|
(0, source_map_support_1.install)();
|
|
23
35
|
const driver_1 = require("./driver");
|
|
24
36
|
var constraints_1 = require("./constraints");
|
|
25
37
|
Object.defineProperty(exports, "commonCapConstraints", { enumerable: true, get: function () { return constraints_1.ANDROID_DRIVER_CONSTRAINTS; } });
|
|
26
38
|
__exportStar(require("./driver"), exports);
|
|
39
|
+
exports.doctor = __importStar(require("./doctor/checks"));
|
|
27
40
|
var android_1 = require("./helpers/android");
|
|
28
41
|
Object.defineProperty(exports, "SETTINGS_HELPER_PKG_ID", { enumerable: true, get: function () { return android_1.SETTINGS_HELPER_PKG_ID; } });
|
|
29
42
|
Object.defineProperty(exports, "androidHelpers", { enumerable: true, get: function () { return __importDefault(android_1).default; } });
|
package/build/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA2C;AAC3C,IAAA,4BAAO,GAAE,CAAC;AAEV,qCAAuC;AAEvC,6CAAiF;AAAzE,mHAAA,0BAA0B,OAAwB;AAC1D,2CAAyB;AACzB,0DAA0C;AAC1C,6CAAoF;AAA5E,iHAAA,sBAAsB,OAAA;AAAE,0HAAA,OAAO,OAAkB;AAEzD,6CAM2B;AALzB,uGAAA,YAAY,OAAA;AACZ,qGAAA,UAAU,OAAA;AACV,uGAAA,YAAY,OAAA;AACZ,sGAAA,WAAW,OAAA;AACX,0HAAA,OAAO,OAAkB;AAG3B,kBAAe,sBAAa,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import {resolveExecutablePath} from './utils';
|
|
2
|
+
import {system, fs, doctor} from '@appium/support';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import '@colors/colors';
|
|
5
|
+
import {getAndroidBinaryPath, getSdkRootFromEnv} from 'appium-adb';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const JAVA_HOME_VAR_NAME = system.isWindows() ? '%JAVA_HOME%' : '$JAVA_HOME';
|
|
9
|
+
const ENVIRONMENT_VARS_TUTORIAL_URL = 'https://github.com/appium/java-client/blob/master/docs/environment.md';
|
|
10
|
+
const JAVA_HOME_TUTORIAL = 'https://docs.oracle.com/cd/E21454_01/html/821-2531/inst_jdk_javahome_t.html';
|
|
11
|
+
const ANDROID_SDK_LINK1 = 'https://developer.android.com/studio#cmdline-tools';
|
|
12
|
+
const ANDROID_SDK_LINK2 = 'https://developer.android.com/studio/intro/update#sdk-manager';
|
|
13
|
+
const BUNDLETOOL_RELEASES_LINK = 'https://github.com/google/bundletool/releases/';
|
|
14
|
+
const GSTREAMER_INSTALL_LINK = 'https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c';
|
|
15
|
+
const FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef EnvVarCheckOptions
|
|
19
|
+
* @property {boolean} [expectDir] If set to true then
|
|
20
|
+
* the path is expected to be a valid folder
|
|
21
|
+
* @property {boolean} [expectFile] If set to true then
|
|
22
|
+
* the path is expected to be a valid file
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
26
|
+
class EnvVarAndPathCheck {
|
|
27
|
+
/**
|
|
28
|
+
* @param {string} varName
|
|
29
|
+
* @param {EnvVarCheckOptions} [opts={}]
|
|
30
|
+
*/
|
|
31
|
+
constructor(varName, opts = {}) {
|
|
32
|
+
this.varName = varName;
|
|
33
|
+
this.opts = opts;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async diagnose() {
|
|
37
|
+
const varValue = process.env[this.varName];
|
|
38
|
+
if (!varValue) {
|
|
39
|
+
return doctor.nok(`${this.varName} environment variable is NOT set!`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!await fs.exists(varValue)) {
|
|
43
|
+
let errMsg = `${this.varName} is set to '${varValue}' but this path does not exist!`;
|
|
44
|
+
if (system.isWindows() && varValue.includes('%')) {
|
|
45
|
+
errMsg += ` Consider replacing all references to other environment variables with absolute paths.`;
|
|
46
|
+
}
|
|
47
|
+
return doctor.nok(errMsg);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const stat = await fs.stat(varValue);
|
|
51
|
+
if (this.opts.expectDir && !stat.isDirectory()) {
|
|
52
|
+
return doctor.nok(`${this.varName} is expected to be a valid folder, got a file path instead`);
|
|
53
|
+
}
|
|
54
|
+
if (this.opts.expectFile && stat.isDirectory()) {
|
|
55
|
+
return doctor.nok(`${this.varName} is expected to be a valid file, got a folder path instead`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return doctor.ok(`${this.varName} is set to: ${varValue}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async fix() {
|
|
62
|
+
return (
|
|
63
|
+
`Make sure the environment variable ${this.varName.bold} is properly configured for the Appium process. ` +
|
|
64
|
+
`Refer ${ENVIRONMENT_VARS_TUTORIAL_URL} for more details.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
hasAutofix() {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
isOptional() {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export const androidHomeCheck = new EnvVarAndPathCheck('ANDROID_HOME', {expectDir: true});
|
|
77
|
+
export const javaHomeCheck = new EnvVarAndPathCheck('JAVA_HOME', {expectDir: true});
|
|
78
|
+
|
|
79
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
80
|
+
export class JavaHomeValueCheck {
|
|
81
|
+
async diagnose() {
|
|
82
|
+
const envVar = process.env.JAVA_HOME;
|
|
83
|
+
if (!envVar) {
|
|
84
|
+
return doctor.nok(`${JAVA_HOME_VAR_NAME} environment variable must be set`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const javaBinaryRelativePath = path.join('bin', `java${system.isWindows() ? '.exe' : ''}`);
|
|
88
|
+
const javaBinary = path.join(envVar, javaBinaryRelativePath);
|
|
89
|
+
if (!await fs.exists(javaBinary)) {
|
|
90
|
+
return doctor.nok(
|
|
91
|
+
`${JAVA_HOME_VAR_NAME} is set to an invalid value. ` +
|
|
92
|
+
`It must be pointing to a folder containing ${javaBinaryRelativePath}`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
return doctor.ok(`'${javaBinaryRelativePath}' exists under '${envVar}'`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async fix() {
|
|
99
|
+
return `Set ${JAVA_HOME_VAR_NAME} environment variable to the root folder path of your local JDK installation. ` +
|
|
100
|
+
`Read ${JAVA_HOME_TUTORIAL}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
hasAutofix() {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
isOptional() {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export const javaHomeValueCheck = new JavaHomeValueCheck();
|
|
112
|
+
|
|
113
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
114
|
+
export class AndroidSdkCheck {
|
|
115
|
+
/** @type {import('@appium/types').AppiumLogger} */
|
|
116
|
+
log;
|
|
117
|
+
|
|
118
|
+
TOOL_NAMES = ['adb', 'emulator', `apkanalyzer${system.isWindows() ? '.bat' : ''}`];
|
|
119
|
+
|
|
120
|
+
async diagnose() {
|
|
121
|
+
const listOfTools = this.TOOL_NAMES.join(', ');
|
|
122
|
+
const sdkRoot = getSdkRootFromEnv();
|
|
123
|
+
if (!sdkRoot) {
|
|
124
|
+
return doctor.nok(
|
|
125
|
+
`${listOfTools} could not be found because ANDROID_HOME is NOT set!`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
this.log.info(` Checking ${listOfTools}`);
|
|
130
|
+
const missingBinaries = [];
|
|
131
|
+
for (const binary of this.TOOL_NAMES) {
|
|
132
|
+
try {
|
|
133
|
+
this.log.info(` '${binary}' exists in ${await getAndroidBinaryPath(binary)}`);
|
|
134
|
+
} catch (e) {
|
|
135
|
+
missingBinaries.push(binary);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (missingBinaries.length > 0) {
|
|
140
|
+
return doctor.nok(`${missingBinaries.join(', ')} could NOT be found in '${sdkRoot}'!`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return doctor.ok(`${listOfTools} exist in '${sdkRoot}'`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async fix() {
|
|
147
|
+
return (
|
|
148
|
+
`Manually install ${'Android SDK'.bold} and set ${'ANDROID_HOME'.bold}. ` +
|
|
149
|
+
`Read ${[ANDROID_SDK_LINK1, ANDROID_SDK_LINK2].join(' and ')}.`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
hasAutofix() {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
isOptional() {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export const androidSdkCheck = new AndroidSdkCheck();
|
|
162
|
+
|
|
163
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
164
|
+
export class OptionalBundletoolCheck {
|
|
165
|
+
async diagnose() {
|
|
166
|
+
const bundletoolPath = await resolveExecutablePath('bundletool.jar');
|
|
167
|
+
return bundletoolPath
|
|
168
|
+
? doctor.okOptional(`bundletool.jar is installed at: ${bundletoolPath}`)
|
|
169
|
+
: doctor.nokOptional('bundletool.jar cannot be found');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async fix() {
|
|
173
|
+
return (
|
|
174
|
+
`${'bundletool.jar'.bold} is used to handle Android App bundles. ` +
|
|
175
|
+
`Please download the binary from ${BUNDLETOOL_RELEASES_LINK} and store it ` +
|
|
176
|
+
`to any folder listed in the PATH environment variable. Folders that ` +
|
|
177
|
+
`are currently present in PATH: ${process.env.PATH}`
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
hasAutofix() {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
isOptional() {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
export const optionalBundletoolCheck = new OptionalBundletoolCheck();
|
|
190
|
+
|
|
191
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
192
|
+
export class OptionalGstreamerCheck {
|
|
193
|
+
GSTREAMER_BINARY = `gst-launch-1.0${system.isWindows() ? '.exe' : ''}`;
|
|
194
|
+
GST_INSPECT_BINARY = `gst-inspect-1.0${system.isWindows() ? '.exe' : ''}`;
|
|
195
|
+
|
|
196
|
+
async diagnose() {
|
|
197
|
+
const gstreamerPath = await resolveExecutablePath(this.GSTREAMER_BINARY);
|
|
198
|
+
const gstInspectPath = await resolveExecutablePath(this.GST_INSPECT_BINARY);
|
|
199
|
+
|
|
200
|
+
return gstreamerPath && gstInspectPath
|
|
201
|
+
? doctor.okOptional(
|
|
202
|
+
`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY} are installed at: ${gstreamerPath} and ${gstInspectPath}`
|
|
203
|
+
)
|
|
204
|
+
: doctor.nokOptional(`${this.GSTREAMER_BINARY} and/or ${this.GST_INSPECT_BINARY} cannot be found`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async fix() {
|
|
208
|
+
return (
|
|
209
|
+
`${
|
|
210
|
+
`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY}`.bold
|
|
211
|
+
} are used to stream the screen of the device under test. ` +
|
|
212
|
+
`Please read ${GSTREAMER_INSTALL_LINK}.`
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
hasAutofix() {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
isOptional() {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export const optionalGstreamerCheck = new OptionalGstreamerCheck();
|
|
225
|
+
|
|
226
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
227
|
+
export class OptionalFfmpegCheck {
|
|
228
|
+
FFMPEG_BINARY = `ffmpeg${system.isWindows() ? '.exe' : ''}`;
|
|
229
|
+
|
|
230
|
+
async diagnose() {
|
|
231
|
+
const ffmpegPath = await resolveExecutablePath(this.FFMPEG_BINARY);
|
|
232
|
+
|
|
233
|
+
return ffmpegPath
|
|
234
|
+
? doctor.okOptional(`${this.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
235
|
+
: doctor.nokOptional(`${this.FFMPEG_BINARY} cannot be found`);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
async fix() {
|
|
239
|
+
return (
|
|
240
|
+
`${`${this.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
241
|
+
`Please read ${FFMPEG_INSTALL_LINK}.`
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
hasAutofix() {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
isOptional() {
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {fs} from '@appium/support';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Return an executable path of cmd
|
|
5
|
+
*
|
|
6
|
+
* @param {string} cmd Standard output by command
|
|
7
|
+
* @return {Promise<string?>} The full path of cmd. `null` if the cmd is not found.
|
|
8
|
+
*/
|
|
9
|
+
export async function resolveExecutablePath(cmd) {
|
|
10
|
+
try {
|
|
11
|
+
const executablePath = await fs.which(cmd);
|
|
12
|
+
if (executablePath && (await fs.exists(executablePath))) {
|
|
13
|
+
return executablePath;
|
|
14
|
+
}
|
|
15
|
+
} catch (err) {}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
package/lib/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {AndroidDriver} from './driver';
|
|
|
5
5
|
export type * from './commands';
|
|
6
6
|
export {ANDROID_DRIVER_CONSTRAINTS as commonCapConstraints} from './constraints';
|
|
7
7
|
export * from './driver';
|
|
8
|
+
export * as doctor from './doctor/checks';
|
|
8
9
|
export {SETTINGS_HELPER_PKG_ID, default as androidHelpers} from './helpers/android';
|
|
9
10
|
export type * from './helpers/types';
|
|
10
11
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-android-driver",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.1",
|
|
4
4
|
"description": "Android UiAutomator and Chrome support for Appium",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"appium",
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"singleQuote": true
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
+
"@appium/support": "^4.2.0",
|
|
59
|
+
"@colors/colors": "^1.6.0",
|
|
58
60
|
"appium-adb": "^11.0.1",
|
|
59
61
|
"appium-chromedriver": "^5.5.1",
|
|
60
62
|
"asyncbox": "^3.0.0",
|
|
@@ -75,7 +77,6 @@
|
|
|
75
77
|
"devDependencies": {
|
|
76
78
|
"@appium/eslint-config-appium": "^8.0.4",
|
|
77
79
|
"@appium/eslint-config-appium-ts": "^0.x",
|
|
78
|
-
"@appium/support": "^4.1.2",
|
|
79
80
|
"@appium/test-support": "^3.0.20",
|
|
80
81
|
"@appium/tsconfig": "^0.x",
|
|
81
82
|
"@appium/types": "^0.x",
|