Skip to content

Commit 96af540

Browse files
rosen-vladimirovDimitar Kerezov
authored andcommitted
Do not kill ios-device-lib in tns run
1 parent 869c95a commit 96af540

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

lib/commands/run.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export class RunCommandBase implements ICommand {
88
protected $emulatorPlatformService: IEmulatorPlatformService,
99
protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
1010
private $devicesService: Mobile.IDevicesService,
11-
private $hostInfo: IHostInfo) {
11+
private $hostInfo: IHostInfo,
12+
private $iosDeviceOperations: IIOSDeviceOperations,
13+
private $mobileHelper: Mobile.IMobileHelper) {
1214
this.$projectData.initializeProjectData();
1315
}
1416

@@ -56,7 +58,6 @@ export class RunCommandBase implements ICommand {
5658

5759
await this.$platformService.buildPlatform(d.deviceInfo.platform, buildConfig, this.$projectData);
5860
const pathToBuildResult = await this.$platformService.lastOutputPath(d.deviceInfo.platform, buildConfig, this.$projectData);
59-
console.log("3##### return path to buildResult = ", pathToBuildResult);
6061
return pathToBuildResult;
6162
}
6263
};
@@ -75,8 +76,11 @@ export class RunCommandBase implements ICommand {
7576
// return this.$platformService.trackProjectType(this.$projectData);
7677
// }
7778

78-
// TODO: Fix this call
79-
const liveSyncInfo: ILiveSyncInfo = { projectDir: this.$projectData.projectDir, skipWatcher: !this.$options.watch || this.$options.justlaunch, watchAllFiles: this.$options.syncAllFiles };
79+
if ((!this.platform || this.$mobileHelper.isiOSPlatform(this.platform)) && (this.$options.watch || !this.$options.justlaunch)) {
80+
this.$iosDeviceOperations.setShouldDispose(false);
81+
}
82+
83+
const liveSyncInfo: ILiveSyncInfo = { projectDir: this.$projectData.projectDir, skipWatcher: !this.$options.watch, watchAllFiles: this.$options.syncAllFiles };
8084
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);
8185
}
8286
}
@@ -97,8 +101,10 @@ export class RunIosCommand extends RunCommandBase implements ICommand {
97101
$options: IOptions,
98102
$emulatorPlatformService: IEmulatorPlatformService,
99103
$devicesService: Mobile.IDevicesService,
100-
$hostInfo: IHostInfo) {
101-
super($platformService, $liveSyncService, $projectData, $options, $emulatorPlatformService, $devicePlatformsConstants, $devicesService, $hostInfo);
104+
$hostInfo: IHostInfo,
105+
$iosDeviceOperations: IIOSDeviceOperations,
106+
$mobileHelper: Mobile.IMobileHelper) {
107+
super($platformService, $liveSyncService, $projectData, $options, $emulatorPlatformService, $devicePlatformsConstants, $devicesService, $hostInfo, $iosDeviceOperations, $mobileHelper);
102108
}
103109

104110
public async execute(args: string[]): Promise<void> {
@@ -131,8 +137,10 @@ export class RunAndroidCommand extends RunCommandBase implements ICommand {
131137
$options: IOptions,
132138
$emulatorPlatformService: IEmulatorPlatformService,
133139
$devicesService: Mobile.IDevicesService,
134-
$hostInfo: IHostInfo) {
135-
super($platformService, $liveSyncService, $projectData, $options, $emulatorPlatformService, $devicePlatformsConstants, $devicesService, $hostInfo);
140+
$hostInfo: IHostInfo,
141+
$iosDeviceOperations: IIOSDeviceOperations,
142+
$mobileHelper: Mobile.IMobileHelper) {
143+
super($platformService, $liveSyncService, $projectData, $options, $emulatorPlatformService, $devicePlatformsConstants, $devicesService, $hostInfo, $iosDeviceOperations, $mobileHelper);
136144
}
137145

138146
public async execute(args: string[]): Promise<void> {

0 commit comments

Comments
 (0)