Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Before installing the `mobile-cli-lib`, verify that your system meets the follow

* iTunes (latest official)
* For testing in the native emulator
* Xcode 5 or later
* Xcode

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

Expand Down
1 change: 0 additions & 1 deletion lib/common/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ injector.require(
"./mobile/ios/device/ios-device-operations"
);

injector.require("iTunesValidator", "./validators/iTunes-validator");
injector.require("deviceDiscovery", "./mobile/mobile-core/device-discovery");
injector.require(
"iOSDeviceDiscovery",
Expand Down
4 changes: 0 additions & 4 deletions lib/common/definitions/mobile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,6 @@ declare global {
webSocketDebuggerUrl: string;
}

interface IiTunesValidator {
getError(): string;
}

interface ILocalToDevicePathData {
getLocalPath(): string;
getDevicePath(): string;
Expand Down
53 changes: 18 additions & 35 deletions lib/common/mobile/mobile-core/ios-device-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,15 @@ import { IInjector } from "../../definitions/yok";
import { injector } from "../../yok";

export class IOSDeviceDiscovery extends DeviceDiscovery {
private _iTunesErrorMessage: string;

constructor(
private $injector: IInjector,
private $logger: ILogger,
private $iTunesValidator: Mobile.IiTunesValidator,
private $mobileHelper: Mobile.IMobileHelper,
private $iosDeviceOperations: IIOSDeviceOperations
) {
super();
}

private validateiTunes(): boolean {
if (!this._iTunesErrorMessage) {
this._iTunesErrorMessage = this.$iTunesValidator.getError();

if (this._iTunesErrorMessage) {
this.$logger.warn(this._iTunesErrorMessage);
}
}

return !this._iTunesErrorMessage;
}

public async startLookingForDevices(
options?: Mobile.IDeviceLookingOptions
): Promise<void> {
Expand All @@ -41,28 +26,26 @@ export class IOSDeviceDiscovery extends DeviceDiscovery {
return;
}

if (this.validateiTunes()) {
await this.$iosDeviceOperations.startLookingForDevices(
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
await this.$iosDeviceOperations.startLookingForDevices(
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
const device = this.createDevice(deviceInfo);
this.addDevice(device);
},
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
const currentDevice = this.getDevice(deviceInfo.deviceId);
if (currentDevice) {
const device = this.createDevice(deviceInfo);
this.updateDeviceInfo(device);
} else {
const device = this.createDevice(deviceInfo);
this.addDevice(device);
},
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
const currentDevice = this.getDevice(deviceInfo.deviceId);
if (currentDevice) {
const device = this.createDevice(deviceInfo);
this.updateDeviceInfo(device);
} else {
const device = this.createDevice(deviceInfo);
this.addDevice(device);
}
},
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
this.removeDevice(deviceInfo.deviceId);
},
options
);
}
}
},
(deviceInfo: IOSDeviceLib.IDeviceActionInfo) => {
this.removeDevice(deviceInfo.deviceId);
},
options
);
}

private createDevice(
Expand Down
100 changes: 0 additions & 100 deletions lib/common/validators/iTunes-validator.ts

This file was deleted.

1 change: 0 additions & 1 deletion test/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ function createTestInjector(
testInjector.register("logFilter", LogFilter);
testInjector.register("loggingLevels", LoggingLevels);
testInjector.register("utils", Utils);
testInjector.register("iTunesValidator", {});
testInjector.register("xcprojService", {
getXcprojInfo: () => {
return {
Expand Down