@@ -4,30 +4,15 @@ import { IInjector } from "../../definitions/yok";
4
4
import { injector } from "../../yok" ;
5
5
6
6
export class IOSDeviceDiscovery extends DeviceDiscovery {
7
- private _iTunesErrorMessage : string ;
8
-
9
7
constructor (
10
8
private $injector : IInjector ,
11
9
private $logger : ILogger ,
12
- private $iTunesValidator : Mobile . IiTunesValidator ,
13
10
private $mobileHelper : Mobile . IMobileHelper ,
14
11
private $iosDeviceOperations : IIOSDeviceOperations
15
12
) {
16
13
super ( ) ;
17
14
}
18
15
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
-
31
16
public async startLookingForDevices (
32
17
options ?: Mobile . IDeviceLookingOptions
33
18
) : Promise < void > {
@@ -41,28 +26,26 @@ export class IOSDeviceDiscovery extends DeviceDiscovery {
41
26
return ;
42
27
}
43
28
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 {
47
40
const device = this . createDevice ( deviceInfo ) ;
48
41
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
+ ) ;
66
49
}
67
50
68
51
private createDevice (
0 commit comments