@@ -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,20 @@ 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 deviceFilePath = this . $mobileHelper . buildDevicePath ( deviceRootPath , "removedsync" , helpers . fromWindowsRelativePathToUnix ( localToDevicePathData . getRelativeToProjectBasePath ( ) ) ) ;
295
+ this . device . adb . executeShellCommand ( [ "mkdir" , "-p" , path . dirname ( deviceFilePath ) , "&&" , "touch" , deviceFilePath ] ) . wait ( ) ;
296
+ } )
297
+ } ) . future < void > ( ) ( ) ;
298
+ }
299
+
300
+ private getDeviceRootPath ( appIdentifier : string ) : string {
301
+ return `/data/local/tmp/${ appIdentifier } ` ;
302
+ }
303
+
282
304
private sendPageReloadMessage ( ) : IFuture < void > {
283
305
let future = new Future < void > ( ) ;
284
306
0 commit comments