@@ -217,6 +217,14 @@ export class IOSUsbLiveSyncService implements IiOSUsbLiveSyncService {
217
217
return this . $iOSEmulatorServices . postDarwinNotification ( this . $iOSNotification . attachRequest ) ;
218
218
}
219
219
220
+ public removeFile ( appIdentifier : string , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] ) : IFuture < void > {
221
+ return ( ( ) => {
222
+ _ . each ( localToDevicePaths , localToDevicePathData => {
223
+ this . device . fileSystem . deleteFile ( localToDevicePathData . getDevicePath ( ) , appIdentifier ) ;
224
+ } ) ;
225
+ } ) . future < void > ( ) ( ) ;
226
+ }
227
+
220
228
private sendPageReloadMessage ( socket : net . Socket ) : void {
221
229
try {
222
230
this . sendPageReloadMessageCore ( socket ) ;
@@ -265,7 +273,7 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
265
273
266
274
public beforeLiveSyncAction ( deviceAppData : Mobile . IDeviceAppData ) : IFuture < void > {
267
275
return ( ( ) => {
268
- let deviceRootPath = `/data/local/tmp/ ${ deviceAppData . appIdentifier } ` ;
276
+ let deviceRootPath = this . getDeviceRootPath ( deviceAppData . appIdentifier ) ;
269
277
this . device . adb . executeShellCommand ( [ "rm" , "-rf" , this . $mobileHelper . buildDevicePath ( deviceRootPath , "fullsync" ) ,
270
278
this . $mobileHelper . buildDevicePath ( deviceRootPath , "sync" ) ,
271
279
this . $mobileHelper . buildDevicePath ( deviceRootPath , "removedsync" ) ] ) . wait ( ) ;
@@ -279,6 +287,21 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
279
287
} ) . future < void > ( ) ( ) ;
280
288
}
281
289
290
+ public removeFile ( appIdentifier : string , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] ) : IFuture < void > {
291
+ return ( ( ) => {
292
+ let deviceRootPath = this . getDeviceRootPath ( appIdentifier ) ;
293
+ _ . each ( localToDevicePaths , localToDevicePathData => {
294
+ let relativeUnixPath = _ . trimLeft ( helpers . fromWindowsRelativePathToUnix ( localToDevicePathData . getRelativeToProjectBasePath ( ) ) , "/" ) ;
295
+ let deviceFilePath = this . $mobileHelper . buildDevicePath ( deviceRootPath , "removedsync" , relativeUnixPath ) ;
296
+ this . device . adb . executeShellCommand ( [ "mkdir" , "-p" , path . dirname ( deviceFilePath ) , "&&" , "touch" , deviceFilePath ] ) . wait ( ) ;
297
+ } ) ;
298
+ } ) . future < void > ( ) ( ) ;
299
+ }
300
+
301
+ private getDeviceRootPath ( appIdentifier : string ) : string {
302
+ return `/data/local/tmp/${ appIdentifier } ` ;
303
+ }
304
+
282
305
private sendPageReloadMessage ( ) : IFuture < void > {
283
306
let future = new Future < void > ( ) ;
284
307
0 commit comments