Skip to content

Commit 46df783

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
LiveSync support for iOS simulator
1 parent a52a0fd commit 46df783

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/services/usb-livesync-service.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
2424
$logger: ILogger,
2525
private $injector: IInjector,
2626
private $platformService: IPlatformService,
27-
$dispatcher: IFutureDispatcher) {
28-
super($devicesServices, $mobileHelper, $localToDevicePathDataFactory, $logger, $options, $deviceAppDataFactory, $fs, $dispatcher);
27+
$dispatcher: IFutureDispatcher,
28+
$childProcess: IChildProcess,
29+
$iOSEmulatorServices: Mobile.IiOSSimulatorService,
30+
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants) {
31+
super($devicesServices, $mobileHelper, $localToDevicePathDataFactory, $logger, $options, $deviceAppDataFactory, $fs, $dispatcher, $childProcess, $iOSEmulatorServices);
2932
}
3033

3134
public liveSync(platform: string): IFuture<void> {
@@ -45,6 +48,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
4548
return this.$platformService.deployOnDevice(platform);
4649
}
4750

51+
let notRunningiOSSimulatorAction = (): IFuture<void> => {
52+
return this.$platformService.deployOnEmulator(this.$devicePlatformsConstants.iOS.toLowerCase());
53+
}
54+
4855
let beforeBatchLiveSyncAction = (filePath: string): IFuture<string> => {
4956
return (() => {
5057
this.$platformService.preparePlatform(platform).wait();
@@ -61,7 +68,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
6168

6269
let watchGlob = path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME);
6370

64-
this.sync(platform, this.$projectData.projectId, projectFilesPath, this.excludedProjectDirsAndFiles, watchGlob, restartAppOnDeviceAction, notInstalledAppOnDeviceAction, beforeLiveSyncAction, beforeBatchLiveSyncAction).wait();
71+
this.sync(platform, this.$projectData.projectId, projectFilesPath, this.excludedProjectDirsAndFiles, watchGlob, restartAppOnDeviceAction, notInstalledAppOnDeviceAction, notRunningiOSSimulatorAction, beforeLiveSyncAction, beforeBatchLiveSyncAction).wait();
6572
}).future<void>()();
6673
}
6774

0 commit comments

Comments
 (0)