Skip to content

Commit ac077f0

Browse files
Merge pull request #4216 from NativeScript/vladimirov/fix-vscode-debug-2
fix: debugging in VSCode is not working on iOS Simulator
2 parents 82741af + c22902f commit ac077f0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/common/mobile/ios/device/ios-application-manager.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class IOSApplicationManager extends ApplicationManagerBase {
88

99
constructor(protected $logger: ILogger,
1010
protected $hooksService: IHooksService,
11-
private device: Mobile.IDevice,
11+
private device: Mobile.IiOSDevice,
1212
private $errors: IErrors,
1313
private $iOSNotificationService: IiOSNotificationService,
1414
private $iosDeviceOperations: IIOSDeviceOperations,
@@ -88,6 +88,9 @@ export class IOSApplicationManager extends ApplicationManagerBase {
8888
public async stopApplication(appData: Mobile.IApplicationData): Promise<void> {
8989
const { appId } = appData;
9090

91+
this.device.destroyDebugSocket(appId);
92+
this.device.destroyLiveSyncSocket(appId);
93+
9194
const action = () => this.$iosDeviceOperations.stop([{ deviceId: this.device.deviceInfo.identifier, ddi: this.$options.ddi, appId }]);
9295

9396
try {

lib/common/mobile/ios/simulator/ios-simulator-application-manager.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase {
4747
}
4848

4949
public async stopApplication(appData: Mobile.IApplicationData): Promise<void> {
50-
return this.iosSim.stopApplication(this.device.deviceInfo.identifier, appData.appId, appData.projectName);
50+
const { appId } = appData;
51+
52+
this.device.destroyDebugSocket(appId);
53+
this.device.destroyLiveSyncSocket(appId);
54+
55+
await this.iosSim.stopApplication(this.device.deviceInfo.identifier, appData.appId, appData.projectName);
5156
}
5257

5358
public async getApplicationInfo(applicationIdentifier: string): Promise<Mobile.IApplicationInfo> {

0 commit comments

Comments
 (0)