Skip to content

Commit 2227889

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
LiveSync support for iOS simulator
1 parent 56e77a8 commit 2227889

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> {
@@ -66,9 +69,13 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
6669
}).future<string>()();
6770
}
6871

72+
let notRunningiOSSimulatorAction = (): IFuture<void> => {
73+
return this.$platformService.deployOnEmulator(this.$devicePlatformsConstants.iOS.toLowerCase());
74+
}
75+
6976
let watchGlob = path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME);
7077

71-
this.sync(platform, this.$projectData.projectId, platformData.appDestinationDirectoryPath, projectFilesPath, this.excludedProjectDirsAndFiles, watchGlob, restartAppOnDeviceAction, notInstalledAppOnDeviceAction, beforeBatchLiveSyncAction, canLiveSyncAction).wait();
78+
this.sync(platform, this.$projectData.projectId, platformData.appDestinationDirectoryPath, projectFilesPath, this.excludedProjectDirsAndFiles, watchGlob, restartAppOnDeviceAction, notInstalledAppOnDeviceAction, notRunningiOSSimulatorAction, beforeBatchLiveSyncAction, canLiveSyncAction).wait();
7279
}).future<void>()();
7380
}
7481

0 commit comments

Comments
 (0)