@@ -22,10 +22,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
22
22
private $projectData : IProjectData ,
23
23
$deviceAppDataFactory : Mobile . IDeviceAppDataFactory ,
24
24
$logger : ILogger ,
25
- private $injector : IInjector ,
25
+ $injector : IInjector ,
26
26
private $platformService : IPlatformService ,
27
27
$dispatcher : IFutureDispatcher ) {
28
- super ( $devicesServices , $mobileHelper , $localToDevicePathDataFactory , $logger , $options , $deviceAppDataFactory , $fs , $dispatcher ) ;
28
+ super ( $devicesServices , $mobileHelper , $localToDevicePathDataFactory , $logger , $options , $deviceAppDataFactory , $fs , $dispatcher , $injector ) ;
29
29
}
30
30
31
31
public liveSync ( platform : string ) : IFuture < void > {
@@ -50,11 +50,6 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
50
50
} ) . future < boolean > ( ) ( ) ;
51
51
}
52
52
53
- let restartAppOnDeviceAction = ( device : Mobile . IDevice , deviceAppData : Mobile . IDeviceAppData , localToDevicePaths ?: Mobile . ILocalToDevicePathData [ ] ) : IFuture < void > => {
54
- let platformSpecificUsbLiveSyncService = this . resolveUsbLiveSyncService ( platform || this . $devicesServices . platform , device ) ;
55
- return platformSpecificUsbLiveSyncService . restartApplication ( deviceAppData , localToDevicePaths ) ;
56
- }
57
-
58
53
let notInstalledAppOnDeviceAction = ( device : Mobile . IDevice ) : IFuture < void > => {
59
54
return this . $platformService . deployOnDevice ( platform ) ;
60
55
}
@@ -67,21 +62,13 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
67
62
}
68
63
69
64
let watchGlob = path . join ( this . $projectData . projectDir , constants . APP_FOLDER_NAME ) + "/**/*" ;
70
-
71
- this . sync ( platform , this . $projectData . projectId , platformData . appDestinationDirectoryPath , projectFilesPath , this . excludedProjectDirsAndFiles , watchGlob , restartAppOnDeviceAction , notInstalledAppOnDeviceAction , beforeBatchLiveSyncAction , canLiveSyncAction ) . wait ( ) ;
65
+ let platformSpecificLiveSyncServices : IDictionary < any > = {
66
+ android : AndroidUsbLiveSyncService ,
67
+ ios : IOSUsbLiveSyncService
68
+ } ;
69
+ this . sync ( platform , this . $projectData . projectId , platformData . appDestinationDirectoryPath , projectFilesPath , this . excludedProjectDirsAndFiles , watchGlob , platformSpecificLiveSyncServices , notInstalledAppOnDeviceAction , beforeBatchLiveSyncAction , canLiveSyncAction ) . wait ( ) ;
72
70
} ) . future < void > ( ) ( ) ;
73
71
}
74
-
75
- private resolveUsbLiveSyncService ( platform : string , device : Mobile . IDevice ) : IPlatformSpecificUsbLiveSyncService {
76
- let platformSpecificUsbLiveSyncService : IPlatformSpecificUsbLiveSyncService = null ;
77
- if ( platform . toLowerCase ( ) === "android" ) {
78
- platformSpecificUsbLiveSyncService = this . $injector . resolve ( AndroidUsbLiveSyncService , { _device : device } ) ;
79
- } else if ( platform . toLowerCase ( ) === "ios" ) {
80
- platformSpecificUsbLiveSyncService = this . $injector . resolve ( IOSUsbLiveSyncService , { _device : device } ) ;
81
- }
82
-
83
- return platformSpecificUsbLiveSyncService ;
84
- }
85
72
}
86
73
$injector . register ( "usbLiveSyncService" , UsbLiveSyncService ) ;
87
74
0 commit comments