Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common
25 changes: 24 additions & 1 deletion lib/services/usb-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ export class IOSUsbLiveSyncService implements IiOSUsbLiveSyncService {
return this.$iOSEmulatorServices.postDarwinNotification(this.$iOSNotification.attachRequest);
}

public removeFile(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
return (() => {
_.each(localToDevicePaths, localToDevicePathData => {
this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier);
});
}).future<void>()();
}

private sendPageReloadMessage(socket: net.Socket): void {
try {
this.sendPageReloadMessageCore(socket);
Expand Down Expand Up @@ -265,7 +273,7 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android

public beforeLiveSyncAction(deviceAppData: Mobile.IDeviceAppData): IFuture<void> {
return (() => {
let deviceRootPath = `/data/local/tmp/${deviceAppData.appIdentifier}`;
let deviceRootPath = this.getDeviceRootPath(deviceAppData.appIdentifier);
this.device.adb.executeShellCommand(["rm", "-rf", this.$mobileHelper.buildDevicePath(deviceRootPath, "fullsync"),
this.$mobileHelper.buildDevicePath(deviceRootPath, "sync"),
this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync")]).wait();
Expand All @@ -279,6 +287,21 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
}).future<void>()();
}

public removeFile(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
return (() => {
let deviceRootPath = this.getDeviceRootPath(appIdentifier);
_.each(localToDevicePaths, localToDevicePathData => {
let relativeUnixPath = _.trimLeft(helpers.fromWindowsRelativePathToUnix(localToDevicePathData.getRelativeToProjectBasePath()), "/");
let deviceFilePath = this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync", relativeUnixPath);
this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), "&&", "touch", deviceFilePath]).wait();
});
}).future<void>()();
}

private getDeviceRootPath(appIdentifier: string): string {
return `/data/local/tmp/${appIdentifier}`;
}

private sendPageReloadMessage(): IFuture<void> {
let future = new Future<void>();

Expand Down