Skip to content

Commit 6b3da6e

Browse files
authored
fix: remove iTunesValidator (#5439)
* Update iTunes-validator.ts * refactor: remove iTuneValidator
1 parent 799bb76 commit 6b3da6e

File tree

6 files changed

+19
-142
lines changed

6 files changed

+19
-142
lines changed

lib/common/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Before installing the `mobile-cli-lib`, verify that your system meets the follow
5656

5757
* iTunes (latest official)
5858
* For testing in the native emulator
59-
* Xcode 5 or later
59+
* Xcode
6060

6161
**Additional Software Requirements for Android On-Device Deployment**
6262

lib/common/bootstrap.ts

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ injector.require(
7474
"./mobile/ios/device/ios-device-operations"
7575
);
7676

77-
injector.require("iTunesValidator", "./validators/iTunes-validator");
7877
injector.require("deviceDiscovery", "./mobile/mobile-core/device-discovery");
7978
injector.require(
8079
"iOSDeviceDiscovery",

lib/common/definitions/mobile.d.ts

-4
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,6 @@ declare global {
814814
webSocketDebuggerUrl: string;
815815
}
816816

817-
interface IiTunesValidator {
818-
getError(): string;
819-
}
820-
821817
interface ILocalToDevicePathData {
822818
getLocalPath(): string;
823819
getDevicePath(): string;

lib/common/mobile/mobile-core/ios-device-discovery.ts

+18-35
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,15 @@ import { IInjector } from "../../definitions/yok";
44
import { injector } from "../../yok";
55

66
export class IOSDeviceDiscovery extends DeviceDiscovery {
7-
private _iTunesErrorMessage: string;
8-
97
constructor(
108
private $injector: IInjector,
119
private $logger: ILogger,
12-
private $iTunesValidator: Mobile.IiTunesValidator,
1310
private $mobileHelper: Mobile.IMobileHelper,
1411
private $iosDeviceOperations: IIOSDeviceOperations
1512
) {
1613
super();
1714
}
1815

19-
private validateiTunes(): boolean {
20-
if (!this._iTunesErrorMessage) {
21-
this._iTunesErrorMessage = this.$iTunesValidator.getError();
22-
23-
if (this._iTunesErrorMessage) {
24-
this.$logger.warn(this._iTunesErrorMessage);
25-
}
26-
}
27-
28-
return !this._iTunesErrorMessage;
29-
}
30-
3116
public async startLookingForDevices(
3217
options?: Mobile.IDeviceLookingOptions
3318
): Promise<void> {
@@ -41,28 +26,26 @@ export class IOSDeviceDiscovery extends DeviceDiscovery {
4126
return;
4227
}
4328

44-
if (this.validateiTunes()) {
45-
await this.$iosDeviceOperations.startLookingForDevices(
46-
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
29+
await this.$iosDeviceOperations.startLookingForDevices(
30+
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
31+
const device = this.createDevice(deviceInfo);
32+
this.addDevice(device);
33+
},
34+
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
35+
const currentDevice = this.getDevice(deviceInfo.deviceId);
36+
if (currentDevice) {
37+
const device = this.createDevice(deviceInfo);
38+
this.updateDeviceInfo(device);
39+
} else {
4740
const device = this.createDevice(deviceInfo);
4841
this.addDevice(device);
49-
},
50-
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
51-
const currentDevice = this.getDevice(deviceInfo.deviceId);
52-
if (currentDevice) {
53-
const device = this.createDevice(deviceInfo);
54-
this.updateDeviceInfo(device);
55-
} else {
56-
const device = this.createDevice(deviceInfo);
57-
this.addDevice(device);
58-
}
59-
},
60-
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
61-
this.removeDevice(deviceInfo.deviceId);
62-
},
63-
options
64-
);
65-
}
42+
}
43+
},
44+
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
45+
this.removeDevice(deviceInfo.deviceId);
46+
},
47+
options
48+
);
6649
}
6750

6851
private createDevice(

lib/common/validators/iTunes-validator.ts

-100
This file was deleted.

test/ios-project-service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ function createTestInjector(
125125
testInjector.register("logFilter", LogFilter);
126126
testInjector.register("loggingLevels", LoggingLevels);
127127
testInjector.register("utils", Utils);
128-
testInjector.register("iTunesValidator", {});
129128
testInjector.register("xcprojService", {
130129
getXcprojInfo: () => {
131130
return {

0 commit comments

Comments
 (0)