@@ -167,28 +167,35 @@ export class UsbLiveSyncServiceBase implements IUsbLiveSyncServiceBase {
167
167
168
168
private processRemovedFile ( data : ILiveSyncData , filePath : string ) : void {
169
169
this . $dispatcher . dispatch ( ( ) => ( ( ) => {
170
- if ( ! this . isInitialized ) {
171
- this . $devicesService . initialize ( { platform : data . platform , deviceId : this . $options . device } ) . wait ( ) ;
172
- }
170
+ let synciOSSimulator = this . shouldSynciOSSimulator ( data . platform ) . wait ( ) ;
171
+ if ( synciOSSimulator ) {
172
+ let fileToSync = data . beforeBatchLiveSyncAction ? data . beforeBatchLiveSyncAction ( filePath ) . wait ( ) : filePath ;
173
+ this . $iOSEmulatorServices . removeFiles ( data . appIdentifier , data . projectFilesPath , [ fileToSync ] , data . notRunningiOSSimulatorAction , data . getApplicationPathForiOSSimulatorAction , data . iOSSimulatorRelativeToProjectBasePathAction ) . wait ( ) ;
174
+ } else {
175
+ if ( ! this . isInitialized ) {
176
+ this . $devicesService . initialize ( { platform : data . platform , deviceId : this . $options . device } ) . wait ( ) ;
177
+ }
173
178
174
- let action = ( device : Mobile . IDevice ) => {
175
- return ( ( ) => {
176
- let fileToSync = data . beforeBatchLiveSyncAction ? data . beforeBatchLiveSyncAction ( filePath ) . wait ( ) : filePath ;
177
- let localToDevicePaths = this . createLocalToDevicePaths ( data . platform , data . appIdentifier , data . localProjectRootPath || data . projectFilesPath , [ fileToSync ] ) ;
178
- let platformSpecificLiveSyncService = this . resolvePlatformSpecificLiveSyncService ( data . platform , device , data . platformSpecificLiveSyncServices ) ;
179
- platformSpecificLiveSyncService . removeFile ( data . appIdentifier , localToDevicePaths ) . wait ( ) ;
180
-
181
- let canExecuteFastLiveSync = data . canExecuteFastLiveSync && data . canExecuteFastLiveSync ( filePath ) ;
182
- if ( canExecuteFastLiveSync ) {
183
- data . fastLiveSync ( filePath ) ;
184
- } else {
185
- let platform = data . platform ? this . $mobileHelper . normalizePlatformName ( data . platform ) : this . $devicesService . platform ;
186
- let deviceAppData = this . $deviceAppDataFactory . create ( data . appIdentifier , this . $mobileHelper . normalizePlatformName ( platform ) ) ;
187
- platformSpecificLiveSyncService . restartApplication ( deviceAppData , localToDevicePaths ) . wait ( ) ;
188
- }
189
- } ) . future < void > ( ) ( ) ;
190
- } ;
191
- this . $devicesService . execute ( action ) . wait ( ) ;
179
+ let action = ( device : Mobile . IDevice ) => {
180
+ return ( ( ) => {
181
+ let fileToSync = data . beforeBatchLiveSyncAction ? data . beforeBatchLiveSyncAction ( filePath ) . wait ( ) : filePath ;
182
+ let localToDevicePaths = this . createLocalToDevicePaths ( data . platform , data . appIdentifier , data . localProjectRootPath || data . projectFilesPath , [ fileToSync ] ) ;
183
+ let platformSpecificLiveSyncService = this . resolvePlatformSpecificLiveSyncService ( data . platform , device , data . platformSpecificLiveSyncServices ) ;
184
+ platformSpecificLiveSyncService . removeFile ( data . appIdentifier , localToDevicePaths ) . wait ( ) ;
185
+
186
+ let canExecuteFastLiveSync = data . canExecuteFastLiveSync && data . canExecuteFastLiveSync ( filePath ) ;
187
+ if ( canExecuteFastLiveSync ) {
188
+ data . fastLiveSync ( filePath ) ;
189
+ } else {
190
+ let platform = data . platform ? this . $mobileHelper . normalizePlatformName ( data . platform ) : this . $devicesService . platform ;
191
+ let deviceAppData = this . $deviceAppDataFactory . create ( data . appIdentifier , this . $mobileHelper . normalizePlatformName ( platform ) ) ;
192
+ platformSpecificLiveSyncService . restartApplication ( deviceAppData , localToDevicePaths ) . wait ( ) ;
193
+ }
194
+ } ) . future < void > ( ) ( ) ;
195
+ } ;
196
+
197
+ this . $devicesService . execute ( action ) . wait ( ) ;
198
+ }
192
199
} ) . future < void > ( ) ( ) ) ;
193
200
}
194
201
0 commit comments