appium-xcode 6.1.8 → 6.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +3 -10
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +1 -1
- package/build/lib/index.js.map +1 -1
- package/build/lib/xcode.d.ts.map +1 -1
- package/build/lib/xcode.js +6 -6
- package/build/lib/xcode.js.map +1 -1
- package/lib/helpers.ts +17 -19
- package/lib/index.ts +4 -17
- package/lib/types.ts +0 -1
- package/lib/xcode.ts +54 -37
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [6.1.9](https://github.com/appium/appium-xcode/compare/v6.1.8...v6.1.9) (2026-02-16)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* format ([#170](https://github.com/appium/appium-xcode/issues/170)) ([f15eef3](https://github.com/appium/appium-xcode/commit/f15eef36c6b6722cdfb05ad26dbf637a3f8d50c2))
|
|
6
|
+
|
|
1
7
|
## [6.1.8](https://github.com/appium/appium-xcode/compare/v6.1.7...v6.1.8) (2026-01-28)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAIxD,eAAO,MAAM,aAAa,QAAQ,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,MAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAWxC;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBtE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAGxF"}
|
package/build/lib/helpers.js
CHANGED
|
@@ -42,17 +42,12 @@ async function runXcrunCommand(args, timeout = exports.XCRUN_TIMEOUT) {
|
|
|
42
42
|
async function findAppPaths(bundleId) {
|
|
43
43
|
let stdout;
|
|
44
44
|
try {
|
|
45
|
-
({ stdout } = await (0, teen_process_1.exec)('/usr/bin/mdfind', [
|
|
46
|
-
`kMDItemCFBundleIdentifier=${bundleId}`
|
|
47
|
-
]));
|
|
45
|
+
({ stdout } = await (0, teen_process_1.exec)('/usr/bin/mdfind', [`kMDItemCFBundleIdentifier=${bundleId}`]));
|
|
48
46
|
}
|
|
49
47
|
catch {
|
|
50
48
|
return [];
|
|
51
49
|
}
|
|
52
|
-
const matchedPaths = lodash_1.default.trim(stdout)
|
|
53
|
-
.split('\n')
|
|
54
|
-
.map(lodash_1.default.trim)
|
|
55
|
-
.filter(Boolean);
|
|
50
|
+
const matchedPaths = lodash_1.default.trim(stdout).split('\n').map(lodash_1.default.trim).filter(Boolean);
|
|
56
51
|
if (lodash_1.default.isEmpty(matchedPaths)) {
|
|
57
52
|
return [];
|
|
58
53
|
}
|
|
@@ -71,8 +66,6 @@ async function findAppPaths(bundleId) {
|
|
|
71
66
|
*/
|
|
72
67
|
async function readXcodePlist(developerRoot) {
|
|
73
68
|
const plistPath = node_path_1.default.resolve(developerRoot, '..', 'Info.plist');
|
|
74
|
-
return await support_1.fs.exists(plistPath)
|
|
75
|
-
? await support_1.plist.parsePlistFile(plistPath)
|
|
76
|
-
: {};
|
|
69
|
+
return (await support_1.fs.exists(plistPath)) ? await support_1.plist.parsePlistFile(plistPath) : {};
|
|
77
70
|
}
|
|
78
71
|
//# sourceMappingURL=helpers.js.map
|
package/build/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":";;;;;;AAiBA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":";;;;;;AAiBA,0CAcC;AAQD,oCAoBC;AAQD,wCAGC;AAtED,oDAAuB;AACvB,wDAAyB;AACzB,+CAAkC;AAElC,6CAA0C;AAC1C,0DAA6B;AAEhB,QAAA,aAAa,GAAG,KAAK,CAAC;AAEnC;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe,CACnC,IAAc,EACd,UAAkB,qBAAa;IAE/B,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,mBAAI,EAAC,OAAO,EAAE,IAAI,EAAE,EAAC,OAAO,EAAC,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,iDAAiD;QACjD,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,GAAG,CAAC,OAAO,GAAG,GAAG,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;QAChD,CAAC;QAED,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,CAAC,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,iBAAiB,EAAE,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IACxF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,gBAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5E,IAAI,gBAAC,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACrC,CAAC,KAAK,IAAI,EAAE;QACV,IAAI,MAAM,YAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC,CAAC,EAAE,CACL,CAAC;IACF,OAAO,CAAC,MAAM,kBAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAa,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAClE,OAAO,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,eAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,CAAC"}
|
package/build/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AAE1F,QAAA,MAAM,KAAK;;;;;;CAMV,CAAC;AAEF,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAC,CAAC;AAC3E,eAAe,KAAK,CAAC;AAErB,YAAY,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC"}
|
package/build/lib/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const xcode = {
|
|
|
13
13
|
getVersion: xcode_1.getVersion,
|
|
14
14
|
getMaxIOSSDK: xcode_1.getMaxIOSSDK,
|
|
15
15
|
getMaxTVOSSDK: xcode_1.getMaxTVOSSDK,
|
|
16
|
-
getClangVersion: xcode_1.getClangVersion
|
|
16
|
+
getClangVersion: xcode_1.getClangVersion,
|
|
17
17
|
};
|
|
18
18
|
exports.default = xcode;
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/build/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,mCAA0F;AAUlF,wFAVA,eAAO,OAUA;AAAE,2FAVA,kBAAU,OAUA;AAAE,6FAVA,oBAAY,OAUA;AAAE,8FAVA,qBAAa,OAUA;AAAE,gGAVA,uBAAe,OAUA;AARzE,MAAM,KAAK,GAAG;IACZ,OAAO,EAAP,eAAO;IACP,UAAU,EAAV,kBAAU;IACV,YAAY,EAAZ,oBAAY;IACZ,aAAa,EAAb,qBAAa;IACb,eAAe,EAAf,uBAAe;CAChB,CAAC;AAGF,kBAAe,KAAK,CAAC"}
|
package/build/lib/xcode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,QAAQ,CAAC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package/build/lib/xcode.js
CHANGED
|
@@ -67,8 +67,8 @@ async function getPathFromXcodeSelect(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
67
67
|
return `${prefix}. Consider installing Xcode to address this issue.`;
|
|
68
68
|
}
|
|
69
69
|
const proposals = xcodePaths.map((p) => ` sudo xcode-select -s "${node_path_1.default.join(p, 'Contents', 'Developer')}"`);
|
|
70
|
-
return `${prefix}. ` +
|
|
71
|
-
`Consider running${proposals.length > 1 ? ' any of' : ''}:\n${proposals.join('\n')}\nto address this issue
|
|
70
|
+
return (`${prefix}. ` +
|
|
71
|
+
`Consider running${proposals.length > 1 ? ' any of' : ''}:\n${proposals.join('\n')}\nto address this issue.`);
|
|
72
72
|
};
|
|
73
73
|
let stdout;
|
|
74
74
|
try {
|
|
@@ -109,8 +109,8 @@ async function getPathFromDeveloperDir() {
|
|
|
109
109
|
if (CFBundleIdentifier === XCODE_BUNDLE_ID) {
|
|
110
110
|
return developerRoot;
|
|
111
111
|
}
|
|
112
|
-
const msg =
|
|
113
|
-
`environment variable is not a valid path
|
|
112
|
+
const msg = `The path to Xcode Developer dir '${developerRoot}' provided in DEVELOPER_DIR ` +
|
|
113
|
+
`environment variable is not a valid path`;
|
|
114
114
|
throw new Error(msg);
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
@@ -122,7 +122,7 @@ async function getPathFromDeveloperDir() {
|
|
|
122
122
|
*/
|
|
123
123
|
exports.getPath = lodash_1.default.memoize((timeout = helpers_1.XCRUN_TIMEOUT) => process.env.DEVELOPER_DIR ? getPathFromDeveloperDir() : getPathFromXcodeSelect(timeout));
|
|
124
124
|
async function getVersion(parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
125
|
-
const version = await getVersionMemoized(retries, timeout);
|
|
125
|
+
const version = (await getVersionMemoized(retries, timeout));
|
|
126
126
|
// xcode version strings are not exactly semver string: patch versions of 0
|
|
127
127
|
// are removed (e.g., '10.0.0' => '10.0')
|
|
128
128
|
const versionString = version.patch > 0 ? version.version : `${version.major}.${version.minor}`;
|
|
@@ -218,7 +218,7 @@ async function getMaxTVOSSDKWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
218
218
|
* @throws {Error} If the SDK version number cannot be determined
|
|
219
219
|
*/
|
|
220
220
|
exports.getMaxTVOSSDK = lodash_1.default.memoize(async function getMaxTVOSSDK(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
221
|
-
return await (0, asyncbox_1.retry)(retries, getMaxTVOSSDKWithoutRetry, timeout);
|
|
221
|
+
return (await (0, asyncbox_1.retry)(retries, getMaxTVOSSDKWithoutRetry, timeout));
|
|
222
222
|
});
|
|
223
223
|
// Private helper functions
|
|
224
224
|
/**
|
package/build/lib/xcode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,wDAuCC;AASD,0DAeC;AA6BD,gCAuBC;AAUD,0CAiBC;AASD,4DASC;AAwBD,8DAQC;AArND,6CAA2C;AAC3C,0DAA6B;AAC7B,uCAA+B;AAC/B,oDAAuB;AACvB,+CAAkC;AAClC,+CAAiC;AACjC,uCAAuF;AAGvF,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C,MAAM,GAAG,GAAG,gBAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAEtC;;;;;;GAMG;AACI,KAAK,UAAU,sBAAsB,CAAC,UAAkB,uBAAa;IAC1E,MAAM,oBAAoB,GAAG,KAAK,EAAE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EAC3C,UAAkB,uBAAa;IAE/B,OAAO,CAAC,MAAM,IAAA,gBAAK,EAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC,CAAW,CAAC;AAC9E,CAAC,CAAC,CAAC;AAEH,2BAA2B;AAE3B;;;;;;GAMG;AACH,KAAK,UAAU,sBAAsB,CACnC,UAAkB,uBAAa;IAE/B,MAAM,aAAa,GAAG,MAAM,IAAA,eAAO,EAAC,OAAO,CAAC,CAAC;IAC7C,qEAAqE;IACrE,MAAM,EAAC,0BAA0B,EAAC,GAAG,MAAM,IAAA,wBAAc,EAAC,aAAa,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,gBAAC,CAAC,OAAO,CAAC,SAAS,kBAAkB,CAC9D,UAAkB,yBAAyB,EAC3C,UAAkB,uBAAa;IAE/B,OAAO,IAAA,gBAAK,EAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC"}
|
package/lib/helpers.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import B from 'bluebird';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
3
|
+
import {exec} from 'teen_process';
|
|
4
|
+
import type {TeenProcessExecResult} from 'teen_process';
|
|
5
|
+
import {fs, plist} from '@appium/support';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
|
|
8
8
|
export const XCRUN_TIMEOUT = 15000;
|
|
@@ -15,7 +15,10 @@ export const XCRUN_TIMEOUT = 15000;
|
|
|
15
15
|
* @returns The result of xcrun execution
|
|
16
16
|
* @throws {Error} If xcrun returned non-zero exit code or timed out
|
|
17
17
|
*/
|
|
18
|
-
export async function runXcrunCommand(
|
|
18
|
+
export async function runXcrunCommand(
|
|
19
|
+
args: string[],
|
|
20
|
+
timeout: number = XCRUN_TIMEOUT,
|
|
21
|
+
): Promise<TeenProcessExecResult<string>> {
|
|
19
22
|
try {
|
|
20
23
|
return await exec('xcrun', args, {timeout});
|
|
21
24
|
} catch (err) {
|
|
@@ -37,25 +40,22 @@ export async function runXcrunCommand(args: string[], timeout: number = XCRUN_TI
|
|
|
37
40
|
export async function findAppPaths(bundleId: string): Promise<string[]> {
|
|
38
41
|
let stdout: string;
|
|
39
42
|
try {
|
|
40
|
-
({stdout} = await exec('/usr/bin/mdfind', [
|
|
41
|
-
`kMDItemCFBundleIdentifier=${bundleId}`
|
|
42
|
-
]));
|
|
43
|
+
({stdout} = await exec('/usr/bin/mdfind', [`kMDItemCFBundleIdentifier=${bundleId}`]));
|
|
43
44
|
} catch {
|
|
44
45
|
return [];
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
const matchedPaths = _.trim(stdout)
|
|
48
|
-
.split('\n')
|
|
49
|
-
.map(_.trim)
|
|
50
|
-
.filter(Boolean);
|
|
48
|
+
const matchedPaths = _.trim(stdout).split('\n').map(_.trim).filter(Boolean);
|
|
51
49
|
if (_.isEmpty(matchedPaths)) {
|
|
52
50
|
return [];
|
|
53
51
|
}
|
|
54
|
-
const results = matchedPaths.map((p) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
const results = matchedPaths.map((p) =>
|
|
53
|
+
(async () => {
|
|
54
|
+
if (await fs.exists(p)) {
|
|
55
|
+
return p;
|
|
56
|
+
}
|
|
57
|
+
})(),
|
|
58
|
+
);
|
|
59
59
|
return (await B.all(results)).filter(Boolean) as string[];
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -67,7 +67,5 @@ export async function findAppPaths(bundleId: string): Promise<string[]> {
|
|
|
67
67
|
*/
|
|
68
68
|
export async function readXcodePlist(developerRoot: string): Promise<Record<string, any>> {
|
|
69
69
|
const plistPath = path.resolve(developerRoot, '..', 'Info.plist');
|
|
70
|
-
return await fs.exists(plistPath)
|
|
71
|
-
? await plist.parsePlistFile(plistPath)
|
|
72
|
-
: {};
|
|
70
|
+
return (await fs.exists(plistPath)) ? await plist.parsePlistFile(plistPath) : {};
|
|
73
71
|
}
|
package/lib/index.ts
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
// transpile:main
|
|
2
|
-
import {
|
|
3
|
-
getPath,
|
|
4
|
-
getVersion,
|
|
5
|
-
getMaxIOSSDK,
|
|
6
|
-
getMaxTVOSSDK,
|
|
7
|
-
getClangVersion,
|
|
8
|
-
} from './xcode';
|
|
2
|
+
import {getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion} from './xcode';
|
|
9
3
|
|
|
10
4
|
const xcode = {
|
|
11
5
|
getPath,
|
|
12
6
|
getVersion,
|
|
13
7
|
getMaxIOSSDK,
|
|
14
8
|
getMaxTVOSSDK,
|
|
15
|
-
getClangVersion
|
|
9
|
+
getClangVersion,
|
|
16
10
|
};
|
|
17
11
|
|
|
18
|
-
export {
|
|
19
|
-
getPath,
|
|
20
|
-
getVersion,
|
|
21
|
-
getMaxIOSSDK,
|
|
22
|
-
getMaxTVOSSDK,
|
|
23
|
-
getClangVersion
|
|
24
|
-
};
|
|
12
|
+
export {getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion};
|
|
25
13
|
export default xcode;
|
|
26
14
|
|
|
27
|
-
export type {
|
|
28
|
-
|
|
15
|
+
export type {XcodeVersion} from './types';
|
package/lib/types.ts
CHANGED
package/lib/xcode.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {fs, logger} from '@appium/support';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import {retry} from 'asyncbox';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
-
import {
|
|
5
|
+
import {exec} from 'teen_process';
|
|
6
6
|
import * as semver from 'semver';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
} from './helpers';
|
|
10
|
-
import type { XcodeVersion } from './types';
|
|
7
|
+
import {runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist} from './helpers';
|
|
8
|
+
import type {XcodeVersion} from './types';
|
|
11
9
|
|
|
12
10
|
const DEFAULT_NUMBER_OF_RETRIES = 2;
|
|
13
11
|
const XCODE_BUNDLE_ID = 'com.apple.dt.Xcode';
|
|
@@ -28,17 +26,22 @@ export async function getPathFromXcodeSelect(timeout: number = XCRUN_TIMEOUT): P
|
|
|
28
26
|
return `${prefix}. Consider installing Xcode to address this issue.`;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
const proposals = xcodePaths.map(
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const proposals = xcodePaths.map(
|
|
30
|
+
(p) => ` sudo xcode-select -s "${path.join(p, 'Contents', 'Developer')}"`,
|
|
31
|
+
);
|
|
32
|
+
return (
|
|
33
|
+
`${prefix}. ` +
|
|
34
|
+
`Consider running${proposals.length > 1 ? ' any of' : ''}:\n${proposals.join('\n')}\nto address this issue.`
|
|
35
|
+
);
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
let stdout: string;
|
|
37
39
|
try {
|
|
38
40
|
({stdout} = await exec('xcode-select', ['--print-path'], {timeout}));
|
|
39
41
|
} catch (e) {
|
|
40
|
-
const msg =
|
|
41
|
-
|
|
42
|
+
const msg =
|
|
43
|
+
`Cannot determine the path to Xcode by running 'xcode-select -p' command. ` +
|
|
44
|
+
`Original error: ${e.stderr || e.message}`;
|
|
42
45
|
throw new Error(msg);
|
|
43
46
|
}
|
|
44
47
|
// trim and remove trailing slash
|
|
@@ -75,10 +78,9 @@ export async function getPathFromDeveloperDir(): Promise<string> {
|
|
|
75
78
|
return developerRoot;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
const msg =
|
|
81
|
+
const msg =
|
|
79
82
|
`The path to Xcode Developer dir '${developerRoot}' provided in DEVELOPER_DIR ` +
|
|
80
|
-
`environment variable is not a valid path
|
|
81
|
-
);
|
|
83
|
+
`environment variable is not a valid path`;
|
|
82
84
|
throw new Error(msg);
|
|
83
85
|
}
|
|
84
86
|
|
|
@@ -91,7 +93,7 @@ export async function getPathFromDeveloperDir(): Promise<string> {
|
|
|
91
93
|
*/
|
|
92
94
|
export const getPath = _.memoize(
|
|
93
95
|
(timeout: number = XCRUN_TIMEOUT): Promise<string> =>
|
|
94
|
-
process.env.DEVELOPER_DIR ? getPathFromDeveloperDir() : getPathFromXcodeSelect(timeout)
|
|
96
|
+
process.env.DEVELOPER_DIR ? getPathFromDeveloperDir() : getPathFromXcodeSelect(timeout),
|
|
95
97
|
);
|
|
96
98
|
|
|
97
99
|
/**
|
|
@@ -104,9 +106,17 @@ export const getPath = _.memoize(
|
|
|
104
106
|
* @throws {Error} If there was a failure while retrieving the version
|
|
105
107
|
*/
|
|
106
108
|
export async function getVersion(parse: false, retries?: number, timeout?: number): Promise<string>;
|
|
107
|
-
export async function getVersion(
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
export async function getVersion(
|
|
110
|
+
parse: true,
|
|
111
|
+
retries?: number,
|
|
112
|
+
timeout?: number,
|
|
113
|
+
): Promise<XcodeVersion>;
|
|
114
|
+
export async function getVersion(
|
|
115
|
+
parse: boolean = false,
|
|
116
|
+
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
117
|
+
timeout: number = XCRUN_TIMEOUT,
|
|
118
|
+
): Promise<string | XcodeVersion> {
|
|
119
|
+
const version = (await getVersionMemoized(retries, timeout)) as semver.SemVer;
|
|
110
120
|
// xcode version strings are not exactly semver string: patch versions of 0
|
|
111
121
|
// are removed (e.g., '10.0.0' => '10.0')
|
|
112
122
|
const versionString = version.patch > 0 ? version.version : `${version.major}.${version.minor}`;
|
|
@@ -138,8 +148,10 @@ export async function getClangVersion(): Promise<string | null> {
|
|
|
138
148
|
try {
|
|
139
149
|
await fs.which('clang');
|
|
140
150
|
} catch {
|
|
141
|
-
log.info(
|
|
142
|
-
'
|
|
151
|
+
log.info(
|
|
152
|
+
'Cannot find clang executable on the local system. ' +
|
|
153
|
+
'Are Xcode Command Line Tools installed?',
|
|
154
|
+
);
|
|
143
155
|
return null;
|
|
144
156
|
}
|
|
145
157
|
const {stdout} = await exec('clang', ['--version']);
|
|
@@ -177,11 +189,12 @@ export async function getMaxIOSSDKWithoutRetry(timeout: number = XCRUN_TIMEOUT):
|
|
|
177
189
|
* @returns The SDK version
|
|
178
190
|
* @throws {Error} If the SDK version number cannot be determined
|
|
179
191
|
*/
|
|
180
|
-
export const getMaxIOSSDK = _.memoize(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
);
|
|
192
|
+
export const getMaxIOSSDK = _.memoize(function getMaxIOSSDK(
|
|
193
|
+
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
194
|
+
timeout: number = XCRUN_TIMEOUT,
|
|
195
|
+
) {
|
|
196
|
+
return retry(retries, getMaxIOSSDKWithoutRetry, timeout);
|
|
197
|
+
});
|
|
185
198
|
|
|
186
199
|
/**
|
|
187
200
|
* Retrieves the maximum version of tvOS SDK supported by the installed Xcode
|
|
@@ -208,11 +221,12 @@ export async function getMaxTVOSSDKWithoutRetry(timeout: number = XCRUN_TIMEOUT)
|
|
|
208
221
|
* @returns The SDK version
|
|
209
222
|
* @throws {Error} If the SDK version number cannot be determined
|
|
210
223
|
*/
|
|
211
|
-
export const getMaxTVOSSDK = _.memoize(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
);
|
|
224
|
+
export const getMaxTVOSSDK = _.memoize(async function getMaxTVOSSDK(
|
|
225
|
+
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
226
|
+
timeout: number = XCRUN_TIMEOUT,
|
|
227
|
+
): Promise<string> {
|
|
228
|
+
return (await retry(retries, getMaxTVOSSDKWithoutRetry, timeout)) as string;
|
|
229
|
+
});
|
|
216
230
|
|
|
217
231
|
// Private helper functions
|
|
218
232
|
|
|
@@ -223,7 +237,9 @@ export const getMaxTVOSSDK = _.memoize(
|
|
|
223
237
|
* @returns Xcode version
|
|
224
238
|
* @throws {Error} If there was a failure while retrieving the version
|
|
225
239
|
*/
|
|
226
|
-
async function getVersionWithoutRetry(
|
|
240
|
+
async function getVersionWithoutRetry(
|
|
241
|
+
timeout: number = XCRUN_TIMEOUT,
|
|
242
|
+
): Promise<semver.SemVer | null> {
|
|
227
243
|
const developerPath = await getPath(timeout);
|
|
228
244
|
// we want to read the CFBundleShortVersionString from Xcode's plist.
|
|
229
245
|
const {CFBundleShortVersionString} = await readXcodePlist(developerPath);
|
|
@@ -238,8 +254,9 @@ async function getVersionWithoutRetry(timeout: number = XCRUN_TIMEOUT): Promise<
|
|
|
238
254
|
* @returns Xcode version
|
|
239
255
|
* @throws {Error} If there was a failure while retrieving the version
|
|
240
256
|
*/
|
|
241
|
-
const getVersionMemoized = _.memoize(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
);
|
|
257
|
+
const getVersionMemoized = _.memoize(function getVersionMemoized(
|
|
258
|
+
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
259
|
+
timeout: number = XCRUN_TIMEOUT,
|
|
260
|
+
): Promise<semver.SemVer | null> {
|
|
261
|
+
return retry(retries, getVersionWithoutRetry, timeout);
|
|
262
|
+
});
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"ios",
|
|
7
7
|
"xcode"
|
|
8
8
|
],
|
|
9
|
-
"version": "6.1.
|
|
9
|
+
"version": "6.1.9",
|
|
10
10
|
"author": "Appium Contributors",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"repository": {
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"dev": "npm run build -- --watch",
|
|
44
44
|
"lint": "eslint .",
|
|
45
45
|
"lint:fix": "npm run lint -- --fix",
|
|
46
|
+
"format": "prettier -w ./lib ./test",
|
|
47
|
+
"format:check": "prettier --check ./lib ./test",
|
|
46
48
|
"prepare": "npm run build",
|
|
47
49
|
"test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.js\"",
|
|
48
50
|
"e2e-test": "mocha --exit --timeout 5m \"./test/e2e/**/*-specs.js\""
|