appium-xcode 6.2.5 → 7.0.0
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 +16 -0
- package/build/lib/helpers.js +12 -21
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/index.d.ts +2 -2
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +8 -16
- package/build/lib/index.js.map +1 -1
- package/build/lib/types.d.ts +6 -0
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/types.js +1 -2
- package/build/lib/xcode.d.ts +1 -1
- package/build/lib/xcode.d.ts.map +1 -1
- package/build/lib/xcode.js +33 -78
- package/build/lib/xcode.js.map +1 -1
- package/lib/index.ts +2 -3
- package/lib/types.ts +6 -0
- package/lib/xcode.ts +3 -3
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [7.0.0](https://github.com/appium/appium-xcode/compare/v6.2.6...v7.0.0) (2026-07-24)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* Consumers using require('appium-xcode') must switch to import/dynamic import() — the package no longer ships a CommonJS entry point.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Migrate the package to ESM ([#188](https://github.com/appium/appium-xcode/issues/188)) ([ea51d54](https://github.com/appium/appium-xcode/commit/ea51d545a3d0f3074e5f2efcc7cab1aa4585419b))
|
|
10
|
+
|
|
11
|
+
## [6.2.6](https://github.com/appium/appium-xcode/compare/v6.2.5...v6.2.6) (2026-07-06)
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* Drop mocha and chai ([#181](https://github.com/appium/appium-xcode/issues/181)) ([4380197](https://github.com/appium/appium-xcode/commit/43801977234339c3ea7a03abe44ae244059c3d53))
|
|
16
|
+
|
|
1
17
|
## [6.2.5](https://github.com/appium/appium-xcode/compare/v6.2.4...v6.2.5) (2026-07-01)
|
|
2
18
|
|
|
3
19
|
### Miscellaneous Chores
|
package/build/lib/helpers.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.XCRUN_TIMEOUT = void 0;
|
|
7
|
-
exports.runXcrunCommand = runXcrunCommand;
|
|
8
|
-
exports.findAppPaths = findAppPaths;
|
|
9
|
-
exports.readXcodePlist = readXcodePlist;
|
|
10
|
-
const teen_process_1 = require("teen_process");
|
|
11
|
-
const support_1 = require("@appium/support");
|
|
12
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
-
exports.XCRUN_TIMEOUT = 15000;
|
|
1
|
+
import { exec } from 'teen_process';
|
|
2
|
+
import { fs, plist } from '@appium/support';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
export const XCRUN_TIMEOUT = 15000;
|
|
14
5
|
/**
|
|
15
6
|
* Executes 'xcrun' command line utility
|
|
16
7
|
*
|
|
@@ -19,9 +10,9 @@ exports.XCRUN_TIMEOUT = 15000;
|
|
|
19
10
|
* @returns The result of xcrun execution
|
|
20
11
|
* @throws {Error} If xcrun returned non-zero exit code or timed out
|
|
21
12
|
*/
|
|
22
|
-
async function runXcrunCommand(args, timeout =
|
|
13
|
+
export async function runXcrunCommand(args, timeout = XCRUN_TIMEOUT) {
|
|
23
14
|
try {
|
|
24
|
-
return await
|
|
15
|
+
return await exec('xcrun', args, { timeout });
|
|
25
16
|
}
|
|
26
17
|
catch (err) {
|
|
27
18
|
if (err instanceof Error) {
|
|
@@ -43,10 +34,10 @@ async function runXcrunCommand(args, timeout = exports.XCRUN_TIMEOUT) {
|
|
|
43
34
|
* @param bundleId Bundle identifier of the target app
|
|
44
35
|
* @returns Full paths to where the app with the given bundle id is present.
|
|
45
36
|
*/
|
|
46
|
-
async function findAppPaths(bundleId) {
|
|
37
|
+
export async function findAppPaths(bundleId) {
|
|
47
38
|
let stdout;
|
|
48
39
|
try {
|
|
49
|
-
({ stdout } = await
|
|
40
|
+
({ stdout } = await exec('/usr/bin/mdfind', [`kMDItemCFBundleIdentifier=${bundleId}`]));
|
|
50
41
|
}
|
|
51
42
|
catch {
|
|
52
43
|
return [];
|
|
@@ -60,7 +51,7 @@ async function findAppPaths(bundleId) {
|
|
|
60
51
|
return [];
|
|
61
52
|
}
|
|
62
53
|
const results = matchedPaths.map((p) => (async () => {
|
|
63
|
-
if (await
|
|
54
|
+
if (await fs.exists(p)) {
|
|
64
55
|
return p;
|
|
65
56
|
}
|
|
66
57
|
})());
|
|
@@ -72,8 +63,8 @@ async function findAppPaths(bundleId) {
|
|
|
72
63
|
* @param developerRoot Full path to the Contents/Developer folder under Xcode.app root
|
|
73
64
|
* @returns All plist entries as an object or an empty object if no plist was found
|
|
74
65
|
*/
|
|
75
|
-
async function readXcodePlist(developerRoot) {
|
|
76
|
-
const plistPath =
|
|
77
|
-
return (await
|
|
66
|
+
export async function readXcodePlist(developerRoot) {
|
|
67
|
+
const plistPath = path.resolve(developerRoot, '..', 'Info.plist');
|
|
68
|
+
return (await fs.exists(plistPath)) ? await plist.parsePlistFile(plistPath) : {};
|
|
78
69
|
}
|
|
79
70
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAC,EAAE,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;AAEnC;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YAAY,CAAC,MAAM,EAAE,CAAC;QACzB,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,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC,CAAC,EAAE,CACL,CAAC;IACF,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAa,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAClE,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,CAAC"}
|
package/build/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion } from './xcode';
|
|
1
|
+
import { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion } from './xcode.js';
|
|
2
2
|
declare const xcode: {
|
|
3
3
|
getPath: ((timeout?: number) => Promise<string>) & {
|
|
4
4
|
cache: Map<unknown, Promise<string>>;
|
|
@@ -14,5 +14,5 @@ declare const xcode: {
|
|
|
14
14
|
};
|
|
15
15
|
export { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion };
|
|
16
16
|
export default xcode;
|
|
17
|
-
export type { XcodeVersion } from './types';
|
|
17
|
+
export type { XcodeVersion } from './types.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/build/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AAE7F,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,YAAY,CAAC"}
|
package/build/lib/index.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getClangVersion = exports.getMaxTVOSSDK = exports.getMaxIOSSDK = exports.getVersion = exports.getPath = void 0;
|
|
4
|
-
// transpile:main
|
|
5
|
-
const xcode_1 = require("./xcode");
|
|
6
|
-
Object.defineProperty(exports, "getPath", { enumerable: true, get: function () { return xcode_1.getPath; } });
|
|
7
|
-
Object.defineProperty(exports, "getVersion", { enumerable: true, get: function () { return xcode_1.getVersion; } });
|
|
8
|
-
Object.defineProperty(exports, "getMaxIOSSDK", { enumerable: true, get: function () { return xcode_1.getMaxIOSSDK; } });
|
|
9
|
-
Object.defineProperty(exports, "getMaxTVOSSDK", { enumerable: true, get: function () { return xcode_1.getMaxTVOSSDK; } });
|
|
10
|
-
Object.defineProperty(exports, "getClangVersion", { enumerable: true, get: function () { return xcode_1.getClangVersion; } });
|
|
1
|
+
import { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion } from './xcode.js';
|
|
11
2
|
const xcode = {
|
|
12
|
-
getPath
|
|
13
|
-
getVersion
|
|
14
|
-
getMaxIOSSDK
|
|
15
|
-
getMaxTVOSSDK
|
|
16
|
-
getClangVersion
|
|
3
|
+
getPath,
|
|
4
|
+
getVersion,
|
|
5
|
+
getMaxIOSSDK,
|
|
6
|
+
getMaxTVOSSDK,
|
|
7
|
+
getClangVersion,
|
|
17
8
|
};
|
|
18
|
-
|
|
9
|
+
export { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion };
|
|
10
|
+
export default xcode;
|
|
19
11
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AAE7F,MAAM,KAAK,GAAG;IACZ,OAAO;IACP,UAAU;IACV,YAAY;IACZ,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAC,CAAC;AAC3E,eAAe,KAAK,CAAC"}
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
export interface XcodeVersion {
|
|
2
|
+
/** The Xcode version as a string, e.g. '10.0' or '10.0.1' */
|
|
2
3
|
versionString: string;
|
|
4
|
+
/** The Xcode version as a float, e.g. 10.0 or 10.1 */
|
|
3
5
|
versionFloat: number;
|
|
6
|
+
/** The major version number, e.g. 10 */
|
|
4
7
|
major: number;
|
|
8
|
+
/** The minor version number, e.g. 1 */
|
|
5
9
|
minor: number;
|
|
10
|
+
/** The patch version number, if present in the version string */
|
|
6
11
|
patch?: number;
|
|
12
|
+
/** Returns {@link versionString} */
|
|
7
13
|
toString(): string;
|
|
8
14
|
}
|
|
9
15
|
//# sourceMappingURL=types.d.ts.map
|
package/build/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,IAAI,MAAM,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,QAAQ,IAAI,MAAM,CAAC;CACpB"}
|
package/build/lib/types.js
CHANGED
package/build/lib/xcode.d.ts
CHANGED
package/build/lib/xcode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAO7C;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,GAAE,MAAs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11
|
-
o[k2] = m[k];
|
|
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
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getMaxTVOSSDK = exports.getMaxIOSSDK = exports.getPath = void 0;
|
|
40
|
-
exports.getPathFromXcodeSelect = getPathFromXcodeSelect;
|
|
41
|
-
exports.getPathFromDeveloperDir = getPathFromDeveloperDir;
|
|
42
|
-
exports.getVersion = getVersion;
|
|
43
|
-
exports.getClangVersion = getClangVersion;
|
|
44
|
-
exports.getMaxIOSSDKWithoutRetry = getMaxIOSSDKWithoutRetry;
|
|
45
|
-
exports.getMaxTVOSSDKWithoutRetry = getMaxTVOSSDKWithoutRetry;
|
|
46
|
-
const support_1 = require("@appium/support");
|
|
47
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
48
|
-
const asyncbox_1 = require("asyncbox");
|
|
49
|
-
const teen_process_1 = require("teen_process");
|
|
50
|
-
const semver = __importStar(require("semver"));
|
|
51
|
-
const helpers_1 = require("./helpers");
|
|
1
|
+
import { fs, logger, util } from '@appium/support';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { retry } from 'asyncbox';
|
|
4
|
+
import { exec } from 'teen_process';
|
|
5
|
+
import * as semver from 'semver';
|
|
6
|
+
import { runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist } from './helpers.js';
|
|
52
7
|
const DEFAULT_NUMBER_OF_RETRIES = 2;
|
|
53
8
|
const XCODE_BUNDLE_ID = 'com.apple.dt.Xcode';
|
|
54
|
-
const log =
|
|
9
|
+
const log = logger.getLogger('Xcode');
|
|
55
10
|
/**
|
|
56
11
|
* Retrieves the full path to Xcode Developer subfolder via xcode-select
|
|
57
12
|
*
|
|
@@ -59,26 +14,26 @@ const log = support_1.logger.getLogger('Xcode');
|
|
|
59
14
|
* @returns Full path to Xcode Developer subfolder
|
|
60
15
|
* @throws {Error} If it is not possible to retrieve a proper path
|
|
61
16
|
*/
|
|
62
|
-
async function getPathFromXcodeSelect(timeout =
|
|
17
|
+
export async function getPathFromXcodeSelect(timeout = XCRUN_TIMEOUT) {
|
|
63
18
|
const generateErrorMessage = async (prefix) => {
|
|
64
|
-
const xcodePaths = await
|
|
19
|
+
const xcodePaths = await findAppPaths(XCODE_BUNDLE_ID);
|
|
65
20
|
if (!xcodePaths.length) {
|
|
66
21
|
return `${prefix}. Consider installing Xcode to address this issue.`;
|
|
67
22
|
}
|
|
68
|
-
const proposals = xcodePaths.map((p) => ` sudo xcode-select -s "${
|
|
23
|
+
const proposals = xcodePaths.map((p) => ` sudo xcode-select -s "${path.join(p, 'Contents', 'Developer')}"`);
|
|
69
24
|
return (`${prefix}. ` +
|
|
70
25
|
`Consider running${proposals.length > 1 ? ' any of' : ''}:\n${proposals.join('\n')}\nto address this issue.`);
|
|
71
26
|
};
|
|
72
27
|
let stdout;
|
|
73
28
|
try {
|
|
74
|
-
({ stdout } = await
|
|
29
|
+
({ stdout } = await exec('xcode-select', ['--print-path'], { timeout }));
|
|
75
30
|
}
|
|
76
31
|
catch (e) {
|
|
77
32
|
const stderr = e && typeof e === 'object' && 'stderr' in e ? String(e.stderr) : '';
|
|
78
33
|
const message = e instanceof Error ? e.message : String(e);
|
|
79
34
|
const msg = `Cannot determine the path to Xcode by running 'xcode-select -p' command. ` +
|
|
80
35
|
`Original error: ${stderr || message}`;
|
|
81
|
-
throw new Error(msg);
|
|
36
|
+
throw new Error(msg, { cause: e });
|
|
82
37
|
}
|
|
83
38
|
// trim and remove trailing slash
|
|
84
39
|
const developerRoot = String(stdout).replace(/\/$/, '').trim();
|
|
@@ -87,7 +42,7 @@ async function getPathFromXcodeSelect(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
87
42
|
throw new Error(msg);
|
|
88
43
|
}
|
|
89
44
|
// xcode-select might also return a path to command line tools
|
|
90
|
-
const { CFBundleIdentifier } = await
|
|
45
|
+
const { CFBundleIdentifier } = await readXcodePlist(developerRoot);
|
|
91
46
|
if (CFBundleIdentifier === XCODE_BUNDLE_ID) {
|
|
92
47
|
return developerRoot;
|
|
93
48
|
}
|
|
@@ -101,12 +56,12 @@ async function getPathFromXcodeSelect(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
101
56
|
* @throws {Error} If it is not possible to retrieve a proper path
|
|
102
57
|
* @privateRemarks This method assumes `DEVELOPER_DIR` is defined.
|
|
103
58
|
*/
|
|
104
|
-
async function getPathFromDeveloperDir() {
|
|
59
|
+
export async function getPathFromDeveloperDir() {
|
|
105
60
|
const developerRoot = process.env.DEVELOPER_DIR;
|
|
106
61
|
if (!developerRoot) {
|
|
107
62
|
throw new Error('DEVELOPER_DIR environment variable is not set');
|
|
108
63
|
}
|
|
109
|
-
const { CFBundleIdentifier } = await
|
|
64
|
+
const { CFBundleIdentifier } = await readXcodePlist(developerRoot);
|
|
110
65
|
if (CFBundleIdentifier === XCODE_BUNDLE_ID) {
|
|
111
66
|
return developerRoot;
|
|
112
67
|
}
|
|
@@ -121,8 +76,8 @@ async function getPathFromDeveloperDir() {
|
|
|
121
76
|
* @returns Full path to Xcode Developer subfolder timeout
|
|
122
77
|
* @throws {Error} If there was an error while retrieving the path.
|
|
123
78
|
*/
|
|
124
|
-
|
|
125
|
-
async function getVersion(parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, timeout =
|
|
79
|
+
export const getPath = util.memoize((timeout = XCRUN_TIMEOUT) => process.env.DEVELOPER_DIR ? getPathFromDeveloperDir() : getPathFromXcodeSelect(timeout));
|
|
80
|
+
export async function getVersion(parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, timeout = XCRUN_TIMEOUT) {
|
|
126
81
|
const version = (await getVersionMemoized(retries, timeout));
|
|
127
82
|
// xcode version strings are not exactly semver string: patch versions of 0
|
|
128
83
|
// are removed (e.g., '10.0.0' => '10.0')
|
|
@@ -149,16 +104,16 @@ async function getVersion(parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, ti
|
|
|
149
104
|
* which is supplied with Command Line Tools. `null` is returned
|
|
150
105
|
* if CLT are not installed.
|
|
151
106
|
*/
|
|
152
|
-
async function getClangVersion() {
|
|
107
|
+
export async function getClangVersion() {
|
|
153
108
|
try {
|
|
154
|
-
await
|
|
109
|
+
await fs.which('clang');
|
|
155
110
|
}
|
|
156
111
|
catch {
|
|
157
112
|
log.info('Cannot find clang executable on the local system. ' +
|
|
158
113
|
'Are Xcode Command Line Tools installed?');
|
|
159
114
|
return null;
|
|
160
115
|
}
|
|
161
|
-
const { stdout } = await
|
|
116
|
+
const { stdout } = await exec('clang', ['--version']);
|
|
162
117
|
const match = /clang-([0-9.]+)/.exec(stdout);
|
|
163
118
|
if (!match) {
|
|
164
119
|
log.info(`Cannot parse clang version from ${stdout}`);
|
|
@@ -173,9 +128,9 @@ async function getClangVersion() {
|
|
|
173
128
|
* @returns The SDK version
|
|
174
129
|
* @throws {Error} If the SDK version number cannot be determined
|
|
175
130
|
*/
|
|
176
|
-
async function getMaxIOSSDKWithoutRetry(timeout =
|
|
131
|
+
export async function getMaxIOSSDKWithoutRetry(timeout = XCRUN_TIMEOUT) {
|
|
177
132
|
const args = ['--sdk', 'iphonesimulator', '--show-sdk-version'];
|
|
178
|
-
const { stdout } = await
|
|
133
|
+
const { stdout } = await runXcrunCommand(args, timeout);
|
|
179
134
|
const sdkVersion = stdout.trim();
|
|
180
135
|
const match = /\d.\d/.exec(stdout);
|
|
181
136
|
if (!match) {
|
|
@@ -191,8 +146,8 @@ async function getMaxIOSSDKWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
191
146
|
* @returns The SDK version
|
|
192
147
|
* @throws {Error} If the SDK version number cannot be determined
|
|
193
148
|
*/
|
|
194
|
-
|
|
195
|
-
return
|
|
149
|
+
export const getMaxIOSSDK = util.memoize(function getMaxIOSSDK(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = XCRUN_TIMEOUT) {
|
|
150
|
+
return retry(retries, getMaxIOSSDKWithoutRetry, timeout);
|
|
196
151
|
});
|
|
197
152
|
/**
|
|
198
153
|
* Retrieves the maximum version of tvOS SDK supported by the installed Xcode
|
|
@@ -201,9 +156,9 @@ exports.getMaxIOSSDK = support_1.util.memoize(function getMaxIOSSDK(retries = DE
|
|
|
201
156
|
* @returns The SDK version
|
|
202
157
|
* @throws {Error} If the SDK version number cannot be determined
|
|
203
158
|
*/
|
|
204
|
-
async function getMaxTVOSSDKWithoutRetry(timeout =
|
|
159
|
+
export async function getMaxTVOSSDKWithoutRetry(timeout = XCRUN_TIMEOUT) {
|
|
205
160
|
const args = ['--sdk', 'appletvsimulator', '--show-sdk-version'];
|
|
206
|
-
const { stdout } = await
|
|
161
|
+
const { stdout } = await runXcrunCommand(args, timeout);
|
|
207
162
|
const sdkVersion = stdout.trim();
|
|
208
163
|
if (isNaN(parseFloat(sdkVersion))) {
|
|
209
164
|
throw new Error(`xcrun returned a non-numeric tvOS SDK version: '${sdkVersion}'`);
|
|
@@ -218,8 +173,8 @@ async function getMaxTVOSSDKWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
218
173
|
* @returns The SDK version
|
|
219
174
|
* @throws {Error} If the SDK version number cannot be determined
|
|
220
175
|
*/
|
|
221
|
-
|
|
222
|
-
return (await
|
|
176
|
+
export const getMaxTVOSSDK = util.memoize(async function getMaxTVOSSDK(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = XCRUN_TIMEOUT) {
|
|
177
|
+
return (await retry(retries, getMaxTVOSSDKWithoutRetry, timeout));
|
|
223
178
|
});
|
|
224
179
|
// Private helper functions
|
|
225
180
|
/**
|
|
@@ -229,10 +184,10 @@ exports.getMaxTVOSSDK = support_1.util.memoize(async function getMaxTVOSSDK(retr
|
|
|
229
184
|
* @returns Xcode version
|
|
230
185
|
* @throws {Error} If there was a failure while retrieving the version
|
|
231
186
|
*/
|
|
232
|
-
async function getVersionWithoutRetry(timeout =
|
|
233
|
-
const developerPath = await
|
|
187
|
+
async function getVersionWithoutRetry(timeout = XCRUN_TIMEOUT) {
|
|
188
|
+
const developerPath = await getPath(timeout);
|
|
234
189
|
// we want to read the CFBundleShortVersionString from Xcode's plist.
|
|
235
|
-
const { CFBundleShortVersionString } = await
|
|
190
|
+
const { CFBundleShortVersionString } = await readXcodePlist(developerPath);
|
|
236
191
|
return semver.coerce(CFBundleShortVersionString);
|
|
237
192
|
}
|
|
238
193
|
/**
|
|
@@ -243,7 +198,7 @@ async function getVersionWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
243
198
|
* @returns Xcode version
|
|
244
199
|
* @throws {Error} If there was a failure while retrieving the version
|
|
245
200
|
*/
|
|
246
|
-
const getVersionMemoized =
|
|
247
|
-
return
|
|
201
|
+
const getVersionMemoized = util.memoize(function getVersionMemoized(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = XCRUN_TIMEOUT) {
|
|
202
|
+
return retry(retries, getVersionWithoutRetry, timeout);
|
|
248
203
|
});
|
|
249
204
|
//# sourceMappingURL=xcode.js.map
|
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":"AAAA,OAAO,EAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAC,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAG1F,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,UAAkB,aAAa;IAC1E,MAAM,oBAAoB,GAAG,KAAK,EAAE,MAAc,EAAmB,EAAE;QACrE,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YACvB,OAAO,GAAG,MAAM,oDAAoD,CAAC;QACvE,CAAC;QAED,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,6BAA6B,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EA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kB,yBAAyB,EAC3C,UAAkB,aAAa;IAE/B,OAAO,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC,CAAW,CAAC;AAC9E,CAAC,CAAC,CAAC;AAEH,2BAA2B;AAE3B;;;;;;GAMG;AACH,KAAK,UAAU,sBAAsB,CACnC,UAAkB,aAAa;IAE/B,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,qEAAqE;IACrE,MAAM,EAAC,0BAA0B,EAAC,GAAG,MAAM,cAAc,CAAC,aAAa,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,kBAAkB,CACjE,UAAkB,yBAAyB,EAC3C,UAAkB,aAAa;IAE/B,OAAO,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC"}
|
package/lib/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion} from './xcode';
|
|
1
|
+
import {getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion} from './xcode.js';
|
|
3
2
|
|
|
4
3
|
const xcode = {
|
|
5
4
|
getPath,
|
|
@@ -12,4 +11,4 @@ const xcode = {
|
|
|
12
11
|
export {getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion};
|
|
13
12
|
export default xcode;
|
|
14
13
|
|
|
15
|
-
export type {XcodeVersion} from './types';
|
|
14
|
+
export type {XcodeVersion} from './types.js';
|
package/lib/types.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export interface XcodeVersion {
|
|
2
|
+
/** The Xcode version as a string, e.g. '10.0' or '10.0.1' */
|
|
2
3
|
versionString: string;
|
|
4
|
+
/** The Xcode version as a float, e.g. 10.0 or 10.1 */
|
|
3
5
|
versionFloat: number;
|
|
6
|
+
/** The major version number, e.g. 10 */
|
|
4
7
|
major: number;
|
|
8
|
+
/** The minor version number, e.g. 1 */
|
|
5
9
|
minor: number;
|
|
10
|
+
/** The patch version number, if present in the version string */
|
|
6
11
|
patch?: number;
|
|
12
|
+
/** Returns {@link versionString} */
|
|
7
13
|
toString(): string;
|
|
8
14
|
}
|
package/lib/xcode.ts
CHANGED
|
@@ -3,8 +3,8 @@ import path from 'node:path';
|
|
|
3
3
|
import {retry} from 'asyncbox';
|
|
4
4
|
import {exec} from 'teen_process';
|
|
5
5
|
import * as semver from 'semver';
|
|
6
|
-
import {runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist} from './helpers';
|
|
7
|
-
import type {XcodeVersion} from './types';
|
|
6
|
+
import {runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist} from './helpers.js';
|
|
7
|
+
import type {XcodeVersion} from './types.js';
|
|
8
8
|
|
|
9
9
|
const DEFAULT_NUMBER_OF_RETRIES = 2;
|
|
10
10
|
const XCODE_BUNDLE_ID = 'com.apple.dt.Xcode';
|
|
@@ -44,7 +44,7 @@ export async function getPathFromXcodeSelect(timeout: number = XCRUN_TIMEOUT): P
|
|
|
44
44
|
const msg =
|
|
45
45
|
`Cannot determine the path to Xcode by running 'xcode-select -p' command. ` +
|
|
46
46
|
`Original error: ${stderr || message}`;
|
|
47
|
-
throw new Error(msg);
|
|
47
|
+
throw new Error(msg, {cause: e});
|
|
48
48
|
}
|
|
49
49
|
// trim and remove trailing slash
|
|
50
50
|
const developerRoot = String(stdout).replace(/\/$/, '').trim();
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"ios",
|
|
7
7
|
"xcode"
|
|
8
8
|
],
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "7.0.0",
|
|
10
10
|
"author": "Appium Contributors",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"repository": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"format": "prettier -w ./lib ./test",
|
|
44
44
|
"format:check": "prettier --check ./lib ./test",
|
|
45
45
|
"prepare": "npm run build",
|
|
46
|
-
"test": "
|
|
47
|
-
"e2e-test": "
|
|
46
|
+
"test": "node --enable-source-maps --test --test-timeout=60000 \"./build/test/unit/**/*.spec.js\"",
|
|
47
|
+
"e2e-test": "node --enable-source-maps --test --test-force-exit --test-concurrency=1 --test-timeout=300000 \"./build/test/e2e/**/*.spec.js\""
|
|
48
48
|
},
|
|
49
49
|
"prettier": {
|
|
50
50
|
"bracketSpacing": false,
|
|
@@ -57,18 +57,19 @@
|
|
|
57
57
|
"@appium/types": "^1.0.0-rc.1",
|
|
58
58
|
"@semantic-release/changelog": "^6.0.1",
|
|
59
59
|
"@semantic-release/git": "^10.0.1",
|
|
60
|
-
"@types/chai": "^5.2.3",
|
|
61
|
-
"@types/chai-as-promised": "^8.0.2",
|
|
62
|
-
"@types/mocha": "^10.0.1",
|
|
63
60
|
"@types/node": "^26.0.0",
|
|
64
61
|
"@types/semver": "^7.7.1",
|
|
65
|
-
"chai": "^6.0.0",
|
|
66
|
-
"chai-as-promised": "^8.0.0",
|
|
67
62
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
68
|
-
"mocha": "^11.0.1",
|
|
69
63
|
"prettier": "^3.9.3",
|
|
70
64
|
"semantic-release": "^25.0.2",
|
|
71
|
-
"ts-node": "^10.9.1",
|
|
72
65
|
"typescript": "^6.0.2"
|
|
66
|
+
},
|
|
67
|
+
"type": "module",
|
|
68
|
+
"exports": {
|
|
69
|
+
".": {
|
|
70
|
+
"types": "./build/lib/index.d.ts",
|
|
71
|
+
"import": "./build/lib/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./package.json": "./package.json"
|
|
73
74
|
}
|
|
74
75
|
}
|