Skip to content

Commit 83e1f05

Browse files
author
Nadezhda Atanasova
authored
Assign debug options to device not to whole live sync data (#3119)
If there are attached multiple devices to be livesynced and only one to be debugged, the debug options should be applied only to this one device. Having them in live sync data is incorrect.
1 parent e51adf0 commit 83e1f05

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

lib/definitions/livesync.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ interface IOptionalOutputPath {
8080
/**
8181
* Describes information for LiveSync on a device.
8282
*/
83-
interface ILiveSyncDeviceInfo extends IOptionalOutputPath {
83+
interface ILiveSyncDeviceInfo extends IOptionalOutputPath, IOptionalDebuggingOptions {
8484
/**
8585
* Device identifier.
8686
*/
@@ -111,7 +111,7 @@ interface ILiveSyncDeviceInfo extends IOptionalOutputPath {
111111
/**
112112
* Describes a LiveSync operation.
113113
*/
114-
interface ILiveSyncInfo extends IProjectDir, IOptionalDebuggingOptions {
114+
interface ILiveSyncInfo extends IProjectDir {
115115
/**
116116
* Defines if the watcher should be skipped. If not passed, fs.Watcher will be started.
117117
*/

lib/services/livesync/livesync-command-helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
6363
const result = await this.$platformService.lastOutputPath(d.deviceInfo.platform, buildConfig, this.$projectData);
6464
return result;
6565
},
66-
debugggingEnabled: deviceDebugMap && deviceDebugMap[d.deviceInfo.identifier]
66+
debugggingEnabled: deviceDebugMap && deviceDebugMap[d.deviceInfo.identifier],
67+
debugOptions: this.$options
6768
};
6869

6970
return info;
@@ -73,8 +74,7 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
7374
projectDir: this.$projectData.projectDir,
7475
skipWatcher: !this.$options.watch,
7576
watchAllFiles: this.$options.syncAllFiles,
76-
clean: this.$options.clean,
77-
debugOptions: this.$options
77+
clean: this.$options.clean
7878
};
7979

8080
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);

lib/services/livesync/livesync-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
243243
}
244244

245245
currentDeviceDescriptor.debugggingEnabled = true;
246+
currentDeviceDescriptor.debugOptions = deviceOption.debugOptions;
246247
const currentDeviceInstance = this.$devicesService.getDeviceByIdentifier(deviceOption.deviceIdentifier);
247248
const attachDebuggerOptions: IAttachDebuggerOptions = {
248249
deviceIdentifier: deviceOption.deviceIdentifier,
@@ -451,7 +452,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
451452
watch: !liveSyncData.skipWatcher
452453
});
453454
await this.$platformService.trackActionForPlatform({ action: "LiveSync", platform: device.deviceInfo.platform, isForDevice: !device.isEmulator, deviceOsVersion: device.deviceInfo.version });
454-
await this.refreshApplication(projectData, liveSyncResultInfo, liveSyncData.debugOptions, deviceBuildInfoDescriptor.outputPath);
455+
await this.refreshApplication(projectData, liveSyncResultInfo, deviceBuildInfoDescriptor.debugOptions, deviceBuildInfoDescriptor.outputPath);
455456

456457
this.emit(LiveSyncEvents.liveSyncStarted, {
457458
projectDir: projectData.projectDir,
@@ -559,7 +560,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
559560
};
560561

561562
const liveSyncResultInfo = await service.liveSyncWatchAction(device, settings);
562-
await this.refreshApplication(projectData, liveSyncResultInfo, liveSyncData.debugOptions, deviceBuildInfoDescriptor.outputPath);
563+
await this.refreshApplication(projectData, liveSyncResultInfo, deviceBuildInfoDescriptor.debugOptions, deviceBuildInfoDescriptor.outputPath);
563564
},
564565
(device: Mobile.IDevice) => {
565566
const liveSyncProcessInfo = this.liveSyncProcessesInfo[projectData.projectDir];

lib/services/test-execution-service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TestExecutionService implements ITestExecutionService {
2828
private $devicesService: Mobile.IDevicesService,
2929
private $analyticsService: IAnalyticsService,
3030
private $childProcess: IChildProcess) {
31-
this.$analyticsService.setShouldDispose(this.$options.justlaunch || !this.$options.watch);
31+
this.$analyticsService.setShouldDispose(this.$options.justlaunch || !this.$options.watch);
3232
}
3333

3434
public platform: string;
@@ -106,7 +106,8 @@ class TestExecutionService implements ITestExecutionService {
106106
await this.$platformService.buildPlatform(d.deviceInfo.platform, buildConfig, projectData);
107107
const pathToBuildResult = await this.$platformService.lastOutputPath(d.deviceInfo.platform, buildConfig, projectData);
108108
return pathToBuildResult;
109-
}
109+
},
110+
debugOptions: this.$options
110111
};
111112

112113
return info;
@@ -116,7 +117,6 @@ class TestExecutionService implements ITestExecutionService {
116117
projectDir: projectData.projectDir,
117118
skipWatcher: !this.$options.watch || this.$options.justlaunch,
118119
watchAllFiles: this.$options.syncAllFiles,
119-
debugOptions: this.$options
120120
};
121121

122122
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);
@@ -221,7 +221,8 @@ class TestExecutionService implements ITestExecutionService {
221221
await this.$platformService.buildPlatform(d.deviceInfo.platform, buildConfig, projectData);
222222
const pathToBuildResult = await this.$platformService.lastOutputPath(d.deviceInfo.platform, buildConfig, projectData);
223223
return pathToBuildResult;
224-
}
224+
},
225+
debugOptions: this.$options
225226
};
226227

227228
return info;
@@ -231,7 +232,6 @@ class TestExecutionService implements ITestExecutionService {
231232
projectDir: projectData.projectDir,
232233
skipWatcher: !this.$options.watch || this.$options.justlaunch,
233234
watchAllFiles: this.$options.syncAllFiles,
234-
debugOptions: this.$options
235235
};
236236

237237
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);

0 commit comments

Comments
 (0)