appium-ios-simulator 8.0.3 → 8.0.5
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/extensions/applications.d.ts +23 -29
- package/build/lib/extensions/applications.d.ts.map +1 -1
- package/build/lib/extensions/applications.js +18 -26
- package/build/lib/extensions/applications.js.map +1 -1
- package/build/lib/extensions/biometric.d.ts +13 -14
- package/build/lib/extensions/biometric.d.ts.map +1 -1
- package/build/lib/extensions/biometric.js +6 -12
- package/build/lib/extensions/biometric.js.map +1 -1
- package/build/lib/extensions/geolocation.d.ts +12 -0
- package/build/lib/extensions/geolocation.d.ts.map +1 -0
- package/build/lib/extensions/geolocation.js +15 -0
- package/build/lib/extensions/geolocation.js.map +1 -0
- package/build/lib/extensions/keychain.d.ts +11 -32
- package/build/lib/extensions/keychain.d.ts.map +1 -1
- package/build/lib/extensions/keychain.js +19 -17
- package/build/lib/extensions/keychain.js.map +1 -1
- package/build/lib/extensions/misc.d.ts +27 -16
- package/build/lib/extensions/misc.d.ts.map +1 -1
- package/build/lib/extensions/misc.js +25 -18
- package/build/lib/extensions/misc.js.map +1 -1
- package/build/lib/extensions/permissions.d.ts +15 -15
- package/build/lib/extensions/permissions.d.ts.map +1 -1
- package/build/lib/extensions/permissions.js +30 -42
- package/build/lib/extensions/permissions.js.map +1 -1
- package/build/lib/extensions/safari.d.ts +15 -19
- package/build/lib/extensions/safari.d.ts.map +1 -1
- package/build/lib/extensions/safari.js +11 -21
- package/build/lib/extensions/safari.js.map +1 -1
- package/build/lib/extensions/settings.d.ts +47 -60
- package/build/lib/extensions/settings.d.ts.map +1 -1
- package/build/lib/extensions/settings.js +39 -60
- package/build/lib/extensions/settings.js.map +1 -1
- package/build/lib/simulator-xcode-14.d.ts +9 -66
- package/build/lib/simulator-xcode-14.d.ts.map +1 -1
- package/build/lib/simulator-xcode-14.js +7 -79
- package/build/lib/simulator-xcode-14.js.map +1 -1
- package/lib/extensions/{applications.js → applications.ts} +37 -35
- package/lib/extensions/{biometric.js → biometric.ts} +18 -17
- package/lib/extensions/geolocation.ts +16 -0
- package/lib/extensions/{keychain.js → keychain.ts} +30 -23
- package/lib/extensions/misc.ts +60 -0
- package/lib/extensions/{permissions.js → permissions.ts} +70 -60
- package/lib/extensions/{safari.js → safari.ts} +23 -29
- package/lib/extensions/{settings.js → settings.ts} +83 -84
- package/lib/simulator-xcode-14.ts +8 -88
- package/package.json +2 -2
- package/lib/extensions/misc.js +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [8.0.5](https://github.com/appium/appium-ios-simulator/compare/v8.0.4...v8.0.5) (2025-12-11)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* **deps-dev:** Bump @types/node from 24.10.3 to 25.0.0 ([#464](https://github.com/appium/appium-ios-simulator/issues/464)) ([290b831](https://github.com/appium/appium-ios-simulator/commit/290b831eb320ac435f99a012127802a920e40e76))
|
|
6
|
+
|
|
7
|
+
## [8.0.4](https://github.com/appium/appium-ios-simulator/compare/v8.0.3...v8.0.4) (2025-12-09)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* Migrate extensions to typescript ([#463](https://github.com/appium/appium-ios-simulator/issues/463)) ([3bc4543](https://github.com/appium/appium-ios-simulator/commit/3bc45431601b76359944aa2b21e676ea5e9cdfbe))
|
|
12
|
+
|
|
1
13
|
## [8.0.3](https://github.com/appium/appium-ios-simulator/compare/v8.0.2...v8.0.3) (2025-12-06)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1,63 +1,57 @@
|
|
|
1
|
+
import type { CoreSimulator, InteractsWithApps, LaunchAppOptions } from '../types';
|
|
2
|
+
type CoreSimulatorWithApps = CoreSimulator & InteractsWithApps;
|
|
1
3
|
/**
|
|
2
4
|
* Install valid .app package on Simulator.
|
|
3
5
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param {string} app - The path to the .app package.
|
|
6
|
+
* @param app The path to the .app package.
|
|
6
7
|
*/
|
|
7
|
-
export function installApp(this: CoreSimulatorWithApps, app: string): Promise<void>;
|
|
8
|
+
export declare function installApp(this: CoreSimulatorWithApps, app: string): Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* Returns user installed bundle ids which has 'bundleName' in their Info.Plist as 'CFBundleName'
|
|
10
11
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
* @return {Promise<string[]>} - The list of bundle ids which have 'bundleName'
|
|
12
|
+
* @param bundleName The bundle name of the application to be checked.
|
|
13
|
+
* @return The list of bundle ids which have 'bundleName'
|
|
14
14
|
*/
|
|
15
|
-
export function getUserInstalledBundleIdsByBundleName(this: CoreSimulatorWithApps, bundleName: string): Promise<string[]>;
|
|
15
|
+
export declare function getUserInstalledBundleIdsByBundleName(this: CoreSimulatorWithApps, bundleName: string): Promise<string[]>;
|
|
16
16
|
/**
|
|
17
17
|
* Verify whether the particular application is installed on Simulator.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
20
|
-
* @
|
|
21
|
-
* @return {Promise<boolean>} True if the given application is installed.
|
|
19
|
+
* @param bundleId The bundle id of the application to be checked.
|
|
20
|
+
* @return True if the given application is installed.
|
|
22
21
|
*/
|
|
23
|
-
export function isAppInstalled(this: CoreSimulatorWithApps, bundleId: string): Promise<boolean>;
|
|
22
|
+
export declare function isAppInstalled(this: CoreSimulatorWithApps, bundleId: string): Promise<boolean>;
|
|
24
23
|
/**
|
|
25
24
|
* Uninstall the given application from the current Simulator.
|
|
26
25
|
*
|
|
27
|
-
* @
|
|
28
|
-
* @param {string} bundleId - The buindle ID of the application to be removed.
|
|
26
|
+
* @param bundleId The bundle ID of the application to be removed.
|
|
29
27
|
*/
|
|
30
|
-
export function removeApp(this: CoreSimulatorWithApps, bundleId: string): Promise<void>;
|
|
28
|
+
export declare function removeApp(this: CoreSimulatorWithApps, bundleId: string): Promise<void>;
|
|
31
29
|
/**
|
|
32
30
|
* Starts the given application on Simulator
|
|
33
31
|
*
|
|
34
|
-
* @
|
|
35
|
-
* @param
|
|
36
|
-
* @param {import('../types').LaunchAppOptions} [opts={}]
|
|
32
|
+
* @param bundleId The bundle ID of the application to be launched
|
|
33
|
+
* @param opts Launch options
|
|
37
34
|
*/
|
|
38
|
-
export function launchApp(this: CoreSimulatorWithApps, bundleId: string, opts?:
|
|
35
|
+
export declare function launchApp(this: CoreSimulatorWithApps, bundleId: string, opts?: LaunchAppOptions): Promise<void>;
|
|
39
36
|
/**
|
|
40
|
-
* Stops the given application on
|
|
37
|
+
* Stops the given application on Simulator.
|
|
41
38
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @param {string} bundleId - The buindle ID of the application to be stopped
|
|
39
|
+
* @param bundleId The bundle ID of the application to be stopped
|
|
44
40
|
*/
|
|
45
|
-
export function terminateApp(this: CoreSimulatorWithApps, bundleId: string): Promise<void>;
|
|
41
|
+
export declare function terminateApp(this: CoreSimulatorWithApps, bundleId: string): Promise<void>;
|
|
46
42
|
/**
|
|
47
43
|
* Check if app with the given identifier is running.
|
|
48
44
|
*
|
|
49
|
-
* @
|
|
50
|
-
* @param {string} bundleId - The buindle ID of the application to be checked.
|
|
45
|
+
* @param bundleId The bundle ID of the application to be checked.
|
|
51
46
|
*/
|
|
52
|
-
export function isAppRunning(this: CoreSimulatorWithApps, bundleId: string): Promise<boolean>;
|
|
47
|
+
export declare function isAppRunning(this: CoreSimulatorWithApps, bundleId: string): Promise<boolean>;
|
|
53
48
|
/**
|
|
54
49
|
* Scrub (delete the preferences and changed files) the particular application on Simulator.
|
|
55
50
|
* The app will be terminated automatically if it is running.
|
|
56
51
|
*
|
|
57
|
-
* @
|
|
58
|
-
* @param {string} bundleId - Bundle identifier of the application.
|
|
52
|
+
* @param bundleId Bundle identifier of the application.
|
|
59
53
|
* @throws {Error} if the given app is not installed.
|
|
60
54
|
*/
|
|
61
|
-
export function scrubApp(this: CoreSimulatorWithApps, bundleId: string): Promise<void>;
|
|
62
|
-
export
|
|
55
|
+
export declare function scrubApp(this: CoreSimulatorWithApps, bundleId: string): Promise<void>;
|
|
56
|
+
export {};
|
|
63
57
|
//# sourceMappingURL=applications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../../lib/extensions/applications.
|
|
1
|
+
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../../lib/extensions/applications.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEnF,KAAK,qBAAqB,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExF;AAED;;;;;GAKG;AACH,wBAAsB,qCAAqC,CACzD,IAAI,EAAE,qBAAqB,EAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAkCnB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBpG;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/F;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAElG;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB3F"}
|
|
@@ -19,8 +19,7 @@ const asyncbox_1 = require("asyncbox");
|
|
|
19
19
|
/**
|
|
20
20
|
* Install valid .app package on Simulator.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
23
|
-
* @param {string} app - The path to the .app package.
|
|
22
|
+
* @param app The path to the .app package.
|
|
24
23
|
*/
|
|
25
24
|
async function installApp(app) {
|
|
26
25
|
return await this.simctl.installApp(app);
|
|
@@ -28,9 +27,8 @@ async function installApp(app) {
|
|
|
28
27
|
/**
|
|
29
28
|
* Returns user installed bundle ids which has 'bundleName' in their Info.Plist as 'CFBundleName'
|
|
30
29
|
*
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
33
|
-
* @return {Promise<string[]>} - The list of bundle ids which have 'bundleName'
|
|
30
|
+
* @param bundleName The bundle name of the application to be checked.
|
|
31
|
+
* @return The list of bundle ids which have 'bundleName'
|
|
34
32
|
*/
|
|
35
33
|
async function getUserInstalledBundleIdsByBundleName(bundleName) {
|
|
36
34
|
const appsRoot = path_1.default.resolve(this.getDir(), 'Containers', 'Bundle', 'Application');
|
|
@@ -48,7 +46,9 @@ async function getUserInstalledBundleIdsByBundleName(bundleName) {
|
|
|
48
46
|
try {
|
|
49
47
|
return await support_1.plist.parsePlistFile(infoPlist);
|
|
50
48
|
}
|
|
51
|
-
catch {
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
52
|
})());
|
|
53
53
|
}
|
|
54
54
|
const bundleInfos = (await bluebird_1.default.all(bundleInfoPromises)).filter(lodash_1.default.isPlainObject);
|
|
@@ -65,9 +65,8 @@ async function getUserInstalledBundleIdsByBundleName(bundleName) {
|
|
|
65
65
|
/**
|
|
66
66
|
* Verify whether the particular application is installed on Simulator.
|
|
67
67
|
*
|
|
68
|
-
* @
|
|
69
|
-
* @
|
|
70
|
-
* @return {Promise<boolean>} True if the given application is installed.
|
|
68
|
+
* @param bundleId The bundle id of the application to be checked.
|
|
69
|
+
* @return True if the given application is installed.
|
|
71
70
|
*/
|
|
72
71
|
async function isAppInstalled(bundleId) {
|
|
73
72
|
try {
|
|
@@ -85,15 +84,15 @@ async function isAppInstalled(bundleId) {
|
|
|
85
84
|
const info = await this.simctl.appInfo(bundleId);
|
|
86
85
|
return info.includes('ApplicationType');
|
|
87
86
|
}
|
|
88
|
-
catch {
|
|
87
|
+
catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
89
90
|
}
|
|
90
|
-
return false;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Uninstall the given application from the current Simulator.
|
|
94
94
|
*
|
|
95
|
-
* @
|
|
96
|
-
* @param {string} bundleId - The buindle ID of the application to be removed.
|
|
95
|
+
* @param bundleId The bundle ID of the application to be removed.
|
|
97
96
|
*/
|
|
98
97
|
async function removeApp(bundleId) {
|
|
99
98
|
await this.simctl.removeApp(bundleId);
|
|
@@ -101,9 +100,8 @@ async function removeApp(bundleId) {
|
|
|
101
100
|
/**
|
|
102
101
|
* Starts the given application on Simulator
|
|
103
102
|
*
|
|
104
|
-
* @
|
|
105
|
-
* @param
|
|
106
|
-
* @param {import('../types').LaunchAppOptions} [opts={}]
|
|
103
|
+
* @param bundleId The bundle ID of the application to be launched
|
|
104
|
+
* @param opts Launch options
|
|
107
105
|
*/
|
|
108
106
|
async function launchApp(bundleId, opts = {}) {
|
|
109
107
|
await this.simctl.launchApp(bundleId);
|
|
@@ -122,10 +120,9 @@ async function launchApp(bundleId, opts = {}) {
|
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
/**
|
|
125
|
-
* Stops the given application on
|
|
123
|
+
* Stops the given application on Simulator.
|
|
126
124
|
*
|
|
127
|
-
* @
|
|
128
|
-
* @param {string} bundleId - The buindle ID of the application to be stopped
|
|
125
|
+
* @param bundleId The bundle ID of the application to be stopped
|
|
129
126
|
*/
|
|
130
127
|
async function terminateApp(bundleId) {
|
|
131
128
|
await this.simctl.terminateApp(bundleId);
|
|
@@ -133,8 +130,7 @@ async function terminateApp(bundleId) {
|
|
|
133
130
|
/**
|
|
134
131
|
* Check if app with the given identifier is running.
|
|
135
132
|
*
|
|
136
|
-
* @
|
|
137
|
-
* @param {string} bundleId - The buindle ID of the application to be checked.
|
|
133
|
+
* @param bundleId The bundle ID of the application to be checked.
|
|
138
134
|
*/
|
|
139
135
|
async function isAppRunning(bundleId) {
|
|
140
136
|
return (await this.ps()).some(({ name }) => name === bundleId);
|
|
@@ -143,8 +139,7 @@ async function isAppRunning(bundleId) {
|
|
|
143
139
|
* Scrub (delete the preferences and changed files) the particular application on Simulator.
|
|
144
140
|
* The app will be terminated automatically if it is running.
|
|
145
141
|
*
|
|
146
|
-
* @
|
|
147
|
-
* @param {string} bundleId - Bundle identifier of the application.
|
|
142
|
+
* @param bundleId Bundle identifier of the application.
|
|
148
143
|
* @throws {Error} if the given app is not installed.
|
|
149
144
|
*/
|
|
150
145
|
async function scrubApp(bundleId) {
|
|
@@ -164,7 +159,4 @@ async function scrubApp(bundleId) {
|
|
|
164
159
|
catch { }
|
|
165
160
|
await bluebird_1.default.all(appFiles.map((p) => support_1.fs.rimraf(p)));
|
|
166
161
|
}
|
|
167
|
-
/**
|
|
168
|
-
* @typedef {import('../types').CoreSimulator & import('../types').InteractsWithApps} CoreSimulatorWithApps
|
|
169
|
-
*/
|
|
170
162
|
//# sourceMappingURL=applications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.js","sourceRoot":"","sources":["../../../lib/extensions/applications.
|
|
1
|
+
{"version":3,"file":"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,GAAG,MAAM,YAAE,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC,GAAG,EAAE,WAAW;QAChB,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,IAAI,QAAQ,QAAQ,cAAI,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACrH,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,MAAM,kBAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
+
import type { CoreSimulator, SupportsBiometric } from '../types';
|
|
2
|
+
type CoreSimulatorWithBiometric = CoreSimulator & SupportsBiometric;
|
|
1
3
|
/**
|
|
2
|
-
* @
|
|
3
|
-
* @returns {Promise<boolean>}
|
|
4
|
+
* @returns Promise that resolves to true if biometric is enrolled
|
|
4
5
|
*/
|
|
5
|
-
export function isBiometricEnrolled(this: CoreSimulatorWithBiometric): Promise<boolean>;
|
|
6
|
+
export declare function isBiometricEnrolled(this: CoreSimulatorWithBiometric): Promise<boolean>;
|
|
6
7
|
/**
|
|
7
|
-
* @
|
|
8
|
-
* @param {boolean} isEnabled
|
|
8
|
+
* @param isEnabled Whether to enable biometric enrollment
|
|
9
9
|
*/
|
|
10
|
-
export function enrollBiometric(this: CoreSimulatorWithBiometric, isEnabled?: boolean): Promise<void>;
|
|
10
|
+
export declare function enrollBiometric(this: CoreSimulatorWithBiometric, isEnabled?: boolean): Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* Sends a notification to match/not match the particular biometric.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @param {boolean} shouldMatch [true] - Set it to true or false in order to emulate
|
|
14
|
+
* @param shouldMatch Set it to true or false in order to emulate
|
|
16
15
|
* matching/not matching the corresponding biometric
|
|
17
|
-
* @param
|
|
16
|
+
* @param biometricName Either touchId or faceId (faceId is only available since iOS 11)
|
|
18
17
|
*/
|
|
19
|
-
export function sendBiometricMatch(this: CoreSimulatorWithBiometric, shouldMatch?: boolean, biometricName?: string): Promise<void>;
|
|
18
|
+
export declare function sendBiometricMatch(this: CoreSimulatorWithBiometric, shouldMatch?: boolean, biometricName?: string): Promise<void>;
|
|
20
19
|
/**
|
|
21
|
-
* @param
|
|
22
|
-
* @returns
|
|
20
|
+
* @param name Biometric name (touchId or faceId)
|
|
21
|
+
* @returns Domain component string
|
|
23
22
|
*/
|
|
24
|
-
export function toBiometricDomainComponent(name: string): string;
|
|
25
|
-
export
|
|
23
|
+
export declare function toBiometricDomainComponent(name: string): string;
|
|
24
|
+
export {};
|
|
26
25
|
//# sourceMappingURL=biometric.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biometric.d.ts","sourceRoot":"","sources":["../../../lib/extensions/biometric.
|
|
1
|
+
{"version":3,"file":"biometric.d.ts","sourceRoot":"","sources":["../../../lib/extensions/biometric.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEjE,KAAK,0BAA0B,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAQpE;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAY5F;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,0BAA0B,EAAE,SAAS,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAahH;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,0BAA0B,EAChC,WAAW,GAAE,OAAc,EAC3B,aAAa,GAAE,MAAkB,GAChC,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/D"}
|
|
@@ -14,8 +14,7 @@ const BIOMETRICS = {
|
|
|
14
14
|
faceId: 'pearl',
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* @
|
|
18
|
-
* @returns {Promise<boolean>}
|
|
17
|
+
* @returns Promise that resolves to true if biometric is enrolled
|
|
19
18
|
*/
|
|
20
19
|
async function isBiometricEnrolled() {
|
|
21
20
|
const { stdout } = await this.simctl.spawnProcess([
|
|
@@ -31,8 +30,7 @@ async function isBiometricEnrolled() {
|
|
|
31
30
|
return match[1] === '1';
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
34
|
-
* @
|
|
35
|
-
* @param {boolean} isEnabled
|
|
33
|
+
* @param isEnabled Whether to enable biometric enrollment
|
|
36
34
|
*/
|
|
37
35
|
async function enrollBiometric(isEnabled = true) {
|
|
38
36
|
this.log.debug(`Setting biometric enrolled state for ${this.udid} Simulator to '${isEnabled ? 'enabled' : 'disabled'}'`);
|
|
@@ -51,10 +49,9 @@ async function enrollBiometric(isEnabled = true) {
|
|
|
51
49
|
/**
|
|
52
50
|
* Sends a notification to match/not match the particular biometric.
|
|
53
51
|
*
|
|
54
|
-
* @
|
|
55
|
-
* @param {boolean} shouldMatch [true] - Set it to true or false in order to emulate
|
|
52
|
+
* @param shouldMatch Set it to true or false in order to emulate
|
|
56
53
|
* matching/not matching the corresponding biometric
|
|
57
|
-
* @param
|
|
54
|
+
* @param biometricName Either touchId or faceId (faceId is only available since iOS 11)
|
|
58
55
|
*/
|
|
59
56
|
async function sendBiometricMatch(shouldMatch = true, biometricName = 'touchId') {
|
|
60
57
|
const domainComponent = toBiometricDomainComponent(biometricName);
|
|
@@ -67,8 +64,8 @@ async function sendBiometricMatch(shouldMatch = true, biometricName = 'touchId')
|
|
|
67
64
|
`for ${this.udid} Simulator`);
|
|
68
65
|
}
|
|
69
66
|
/**
|
|
70
|
-
* @param
|
|
71
|
-
* @returns
|
|
67
|
+
* @param name Biometric name (touchId or faceId)
|
|
68
|
+
* @returns Domain component string
|
|
72
69
|
*/
|
|
73
70
|
function toBiometricDomainComponent(name) {
|
|
74
71
|
if (!BIOMETRICS[name]) {
|
|
@@ -76,7 +73,4 @@ function toBiometricDomainComponent(name) {
|
|
|
76
73
|
}
|
|
77
74
|
return BIOMETRICS[name];
|
|
78
75
|
}
|
|
79
|
-
/**
|
|
80
|
-
* @typedef {import('../types').CoreSimulator & import('../types').SupportsBiometric} CoreSimulatorWithBiometric
|
|
81
|
-
*/
|
|
82
76
|
//# sourceMappingURL=biometric.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biometric.js","sourceRoot":"","sources":["../../../lib/extensions/biometric.
|
|
1
|
+
{"version":3,"file":"biometric.js","sourceRoot":"","sources":["../../../lib/extensions/biometric.ts"],"names":[],"mappings":";;;;;AAcA,kDAYC;AAKD,0CAaC;AASD,gDAeC;AAMD,gEAKC;AA/ED,oDAAuB;AAKvB,MAAM,gCAAgC,GAAG,0CAA0C,CAAC;AACpF,MAAM,UAAU,GAA2B;IACzC,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,mBAAmB;IACvC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QAC9C,YAAY;QACZ,IAAI,EAAE,gCAAgC;KACvC,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,gBAAC,CAAC,YAAY,C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M,GAAG,8BAA8B,eAAe,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;IAC/F,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QAC7B,YAAY;QACZ,IAAI,EAAE,MAAM;KACb,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,IAAI,CACX,qBAAqB,MAAM,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,IAAI,aAAa,aAAa;QACnG,OAAO,IAAI,CAAC,IAAI,YAAY,CAC7B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,IAAY;IACrD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,IAAI,IAAI,2CAA2C,IAAI,CAAC,SAAS,CAAC,gBAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3G,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CoreSimulator, SupportsGeolocation } from '../types';
|
|
2
|
+
type CoreSimulatorWithGeolocation = CoreSimulator & SupportsGeolocation;
|
|
3
|
+
/**
|
|
4
|
+
* Sets the geolocation for the simulator.
|
|
5
|
+
*
|
|
6
|
+
* @param latitude The latitude coordinate.
|
|
7
|
+
* @param longitude The longitude coordinate.
|
|
8
|
+
* @returns True if the geolocation was set successfully.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setGeolocation(this: CoreSimulatorWithGeolocation, latitude: string | number, longitude: string | number): Promise<boolean>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=geolocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/extensions/geolocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEnE,KAAK,4BAA4B,GAAG,aAAa,GAAG,mBAAmB,CAAC;AAExE;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,4BAA4B,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGhJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setGeolocation = setGeolocation;
|
|
4
|
+
/**
|
|
5
|
+
* Sets the geolocation for the simulator.
|
|
6
|
+
*
|
|
7
|
+
* @param latitude The latitude coordinate.
|
|
8
|
+
* @param longitude The longitude coordinate.
|
|
9
|
+
* @returns True if the geolocation was set successfully.
|
|
10
|
+
*/
|
|
11
|
+
async function setGeolocation(latitude, longitude) {
|
|
12
|
+
await this.simctl.setLocation(latitude, longitude);
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=geolocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/extensions/geolocation.ts"],"names":[],"mappings":";;AAWA,wCAGC;AAVD;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAAqC,QAAyB,EAAE,SAA0B;IAC5H,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,54 +1,33 @@
|
|
|
1
|
+
import type { CoreSimulator, InteractsWithKeychain } from '../types';
|
|
2
|
+
type CoreSimulatorWithKeychain = CoreSimulator & InteractsWithKeychain;
|
|
1
3
|
/**
|
|
2
4
|
* Create the backup of keychains folder.
|
|
3
5
|
* The previously created backup will be automatically
|
|
4
6
|
* deleted if this method was called twice in a row without
|
|
5
7
|
* `restoreKeychains` being invoked.
|
|
6
8
|
*
|
|
7
|
-
* @
|
|
8
|
-
* @returns {Promise<boolean>} True if the backup operation was successfull.
|
|
9
|
+
* @returns True if the backup operation was successful.
|
|
9
10
|
*/
|
|
10
|
-
export function backupKeychains(this: CoreSimulatorWithKeychain): Promise<boolean>;
|
|
11
|
-
export class backupKeychains {
|
|
12
|
-
_keychainsBackupPath: string | null | undefined;
|
|
13
|
-
}
|
|
11
|
+
export declare function backupKeychains(this: CoreSimulatorWithKeychain): Promise<boolean>;
|
|
14
12
|
/**
|
|
15
|
-
* Restore the
|
|
13
|
+
* Restore the previously created keychains backup.
|
|
16
14
|
*
|
|
17
|
-
* @
|
|
18
|
-
* @param {string[]} excludePatterns - The list
|
|
15
|
+
* @param excludePatterns The list
|
|
19
16
|
* of file name patterns to be excluded from restore. The format
|
|
20
17
|
* of each item should be the same as '-x' option format for
|
|
21
18
|
* 'unzip' utility. This can also be a comma-separated string,
|
|
22
19
|
* which is going be transformed into a list automatically,
|
|
23
20
|
* for example: '*.db*,blabla.sqlite'
|
|
24
|
-
* @returns
|
|
21
|
+
* @returns If the restore operation was successful.
|
|
25
22
|
* @throws {Error} If there is no keychains backup available for restore.
|
|
26
23
|
*/
|
|
27
|
-
export function restoreKeychains(this: CoreSimulatorWithKeychain, excludePatterns?: string[]): Promise<boolean>;
|
|
28
|
-
export class restoreKeychains {
|
|
29
|
-
/**
|
|
30
|
-
* Restore the previsouly created keychains backup.
|
|
31
|
-
*
|
|
32
|
-
* @this {CoreSimulatorWithKeychain}
|
|
33
|
-
* @param {string[]} excludePatterns - The list
|
|
34
|
-
* of file name patterns to be excluded from restore. The format
|
|
35
|
-
* of each item should be the same as '-x' option format for
|
|
36
|
-
* 'unzip' utility. This can also be a comma-separated string,
|
|
37
|
-
* which is going be transformed into a list automatically,
|
|
38
|
-
* for example: '*.db*,blabla.sqlite'
|
|
39
|
-
* @returns {Promise<boolean>} If the restore opration was successful.
|
|
40
|
-
* @throws {Error} If there is no keychains backup available for restore.
|
|
41
|
-
*/
|
|
42
|
-
constructor(this: CoreSimulatorWithKeychain, excludePatterns?: string[]);
|
|
43
|
-
_keychainsBackupPath: any;
|
|
44
|
-
}
|
|
24
|
+
export declare function restoreKeychains(this: CoreSimulatorWithKeychain, excludePatterns?: string[] | string): Promise<boolean>;
|
|
45
25
|
/**
|
|
46
26
|
* Clears Keychains for the particular simulator in runtime (there is no need to stop it).
|
|
47
27
|
*
|
|
48
|
-
* @
|
|
49
|
-
* @returns {Promise<void>}
|
|
28
|
+
* @returns Promise that resolves when keychains are cleared
|
|
50
29
|
* @throws {Error} If keychain cleanup has failed.
|
|
51
30
|
*/
|
|
52
|
-
export function clearKeychains(this: CoreSimulatorWithKeychain): Promise<void>;
|
|
53
|
-
export
|
|
31
|
+
export declare function clearKeychains(this: CoreSimulatorWithKeychain): Promise<void>;
|
|
32
|
+
export {};
|
|
54
33
|
//# sourceMappingURL=keychain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../../lib/extensions/keychain.
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../../lib/extensions/keychain.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAErE,KAAK,yBAAyB,GAAG,aAAa,GAAG,qBAAqB,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,CA8BvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,yBAAyB,EAC/B,eAAe,GAAE,MAAM,EAAE,GAAG,MAAW,GACtC,OAAO,CAAC,OAAO,CAAC,CAkDlB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcnF"}
|
|
@@ -16,11 +16,10 @@ const teen_process_1 = require("teen_process");
|
|
|
16
16
|
* deleted if this method was called twice in a row without
|
|
17
17
|
* `restoreKeychains` being invoked.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
20
|
-
* @returns {Promise<boolean>} True if the backup operation was successfull.
|
|
19
|
+
* @returns True if the backup operation was successful.
|
|
21
20
|
*/
|
|
22
21
|
async function backupKeychains() {
|
|
23
|
-
const resetBackupPath = async (
|
|
22
|
+
const resetBackupPath = async (newPath) => {
|
|
24
23
|
if (lodash_1.default.isString(this._keychainsBackupPath) && await support_1.fs.exists(this._keychainsBackupPath)) {
|
|
25
24
|
await support_1.fs.unlink(this._keychainsBackupPath);
|
|
26
25
|
}
|
|
@@ -48,16 +47,15 @@ async function backupKeychains() {
|
|
|
48
47
|
return true;
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
51
|
-
* Restore the
|
|
50
|
+
* Restore the previously created keychains backup.
|
|
52
51
|
*
|
|
53
|
-
* @
|
|
54
|
-
* @param {string[]} excludePatterns - The list
|
|
52
|
+
* @param excludePatterns The list
|
|
55
53
|
* of file name patterns to be excluded from restore. The format
|
|
56
54
|
* of each item should be the same as '-x' option format for
|
|
57
55
|
* 'unzip' utility. This can also be a comma-separated string,
|
|
58
56
|
* which is going be transformed into a list automatically,
|
|
59
57
|
* for example: '*.db*,blabla.sqlite'
|
|
60
|
-
* @returns
|
|
58
|
+
* @returns If the restore operation was successful.
|
|
61
59
|
* @throws {Error} If there is no keychains backup available for restore.
|
|
62
60
|
*/
|
|
63
61
|
async function restoreKeychains(excludePatterns = []) {
|
|
@@ -65,8 +63,12 @@ async function restoreKeychains(excludePatterns = []) {
|
|
|
65
63
|
throw new Error(`The keychains backup archive does not exist. ` +
|
|
66
64
|
`Are you sure it was created before?`);
|
|
67
65
|
}
|
|
66
|
+
let patterns = [];
|
|
68
67
|
if (lodash_1.default.isString(excludePatterns)) {
|
|
69
|
-
|
|
68
|
+
patterns = excludePatterns.split(',').map((x) => x.trim());
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
patterns = excludePatterns;
|
|
70
72
|
}
|
|
71
73
|
const isServerRunning = await this.isRunning();
|
|
72
74
|
let plistPath;
|
|
@@ -80,9 +82,13 @@ async function restoreKeychains(excludePatterns = []) {
|
|
|
80
82
|
try {
|
|
81
83
|
await support_1.fs.rimraf(this.keychainPath);
|
|
82
84
|
await (0, support_1.mkdirp)(this.keychainPath);
|
|
85
|
+
const backupPath = this._keychainsBackupPath;
|
|
86
|
+
if (!backupPath) {
|
|
87
|
+
throw new Error('Backup path is not set');
|
|
88
|
+
}
|
|
83
89
|
const unzipArgs = [
|
|
84
|
-
'-o',
|
|
85
|
-
...(lodash_1.default.flatMap(
|
|
90
|
+
'-o', backupPath,
|
|
91
|
+
...(lodash_1.default.flatMap(patterns.map((x) => ['-x', x]))),
|
|
86
92
|
'-d', path_1.default.dirname(this.keychainPath),
|
|
87
93
|
];
|
|
88
94
|
this.log.debug(`Restoring keychains with '${support_1.util.quote(['unzip', ...unzipArgs])}' command`);
|
|
@@ -90,10 +96,10 @@ async function restoreKeychains(excludePatterns = []) {
|
|
|
90
96
|
await (0, teen_process_1.exec)('unzip', unzipArgs);
|
|
91
97
|
}
|
|
92
98
|
catch (err) {
|
|
93
|
-
throw new Error(`Cannot restore keychains from '${
|
|
99
|
+
throw new Error(`Cannot restore keychains from '${backupPath}'. ` +
|
|
94
100
|
`Original error: ${err.stderr || err.stdout || err.message}`);
|
|
95
101
|
}
|
|
96
|
-
await support_1.fs.unlink(
|
|
102
|
+
await support_1.fs.unlink(backupPath);
|
|
97
103
|
this._keychainsBackupPath = null;
|
|
98
104
|
}
|
|
99
105
|
finally {
|
|
@@ -106,8 +112,7 @@ async function restoreKeychains(excludePatterns = []) {
|
|
|
106
112
|
/**
|
|
107
113
|
* Clears Keychains for the particular simulator in runtime (there is no need to stop it).
|
|
108
114
|
*
|
|
109
|
-
* @
|
|
110
|
-
* @returns {Promise<void>}
|
|
115
|
+
* @returns Promise that resolves when keychains are cleared
|
|
111
116
|
* @throws {Error} If keychain cleanup has failed.
|
|
112
117
|
*/
|
|
113
118
|
async function clearKeychains() {
|
|
@@ -126,7 +131,4 @@ async function clearKeychains() {
|
|
|
126
131
|
await this.simctl.spawnProcess(['launchctl', 'load', plistPath]);
|
|
127
132
|
}
|
|
128
133
|
}
|
|
129
|
-
/**
|
|
130
|
-
* @typedef {import('../types').CoreSimulator & import('../types').InteractsWithKeychain} CoreSimulatorWithKeychain
|
|
131
|
-
*/
|
|
132
134
|
//# sourceMappingURL=keychain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../../lib/extensions/keychain.
|
|
1
|
+
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../../lib/extensions/keychain.ts"],"names":[],"mappings":";;;;;AAgBA,0CA8BC;AAcD,4CAqDC;AAQD,wCAcC;AAvID,oDAAuB;AACvB,gDAAwB;AACxB,6CAA4D;AAC5D,+CAAoC;AAKpC;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe;IACnC,MAAM,eAAe,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;QACnE,IAAI,gBAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACxF,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC;IACtC,CAAC,CAAC;IAEF,IAAI,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,gBAAC,CAAC,OAAO,CAAC,MAAM,YAAE,CAAC,OAAO,CA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