Skip to content

Commit ee3be6f

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Implement Android optimizations
1 parent ac77f74 commit ee3be6f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/services/usb-livesync-service.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
132132
platformSpecificUsbLiveSyncService.sendPageReloadMessageToSimulator().wait();
133133
} else {
134134
let deviceAppData = this.$deviceAppDataFactory.create(this.$projectData.projectId, this.$mobileHelper.normalizePlatformName(platform));
135-
let localToDevicePaths = this.createLocalToDevicePaths(platform, this.$projectData.projectId, projectFilesPath, [mappedFilePath]);
135+
let localToDevicePaths = this.createLocalToDevicePaths(platform, this.$projectData.projectId, localProjectRootPath || projectFilesPath, [mappedFilePath]);
136136

137137
let devices = this.$devicesService.getDeviceInstances();
138138
_.each(devices, (device: Mobile.IDevice) => {
139-
this.transferFiles(device, deviceAppData, localToDevicePaths);
139+
this.transferFiles(device, deviceAppData, localToDevicePaths, projectFilesPath, true).wait();
140140
let platformSpecificUsbLiveSyncService = this.resolvePlatformSpecificLiveSyncService(platform || this.$devicesService.platform, device, platformSpecificLiveSyncServices);
141-
return platformSpecificUsbLiveSyncService.sendPageReloadMessageToDevice(deviceAppData);
141+
return platformSpecificUsbLiveSyncService.sendPageReloadMessageToDevice(deviceAppData).wait();
142142
});
143143

144144
this.$dispatcher.dispatch(() => Future.fromResult());
@@ -184,9 +184,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
184184
}
185185
$injector.register("usbLiveSyncService", UsbLiveSyncService);
186186

187+
let currentPageReloadId = 0;
188+
187189
export class IOSUsbLiveSyncService implements IiOSUsbLiveSyncService {
188190
private static BACKEND_PORT = 18181;
189-
private currentPageReloadId = 0;
190191

191192
constructor(private _device: Mobile.IDevice,
192193
private $iOSSocketRequestExecutor: IiOSSocketRequestExecutor,
@@ -219,7 +220,7 @@ export class IOSUsbLiveSyncService implements IiOSUsbLiveSyncService {
219220
}
220221

221222
private sendReloadMessageCore(socket: net.Socket): void {
222-
let message = `{ "method":"Page.reload","params":{"ignoreCache":false},"id":${++this.currentPageReloadId} }`;
223+
let message = `{ "method":"Page.reload","params":{"ignoreCache":false},"id":${++currentPageReloadId} }`;
223224
let length = Buffer.byteLength(message, "utf16le");
224225
let payload = new Buffer(length + 4);
225226
payload.writeInt32BE(length, 0);

0 commit comments

Comments
 (0)