Skip to content

Commit f4ea96b

Browse files
Merge pull request #1701 from NativeScript/vladimirov/fix-debug-simulator
Fix debugging for simulator when --emulator is not passed
2 parents 4b25122 + 2042b8d commit f4ea96b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/services/ios-debug-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class IOSDebugService implements IDebugService {
6868
public debugStart(): IFuture<void> {
6969
return (() => {
7070
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
71-
this.$devicesService.execute((device: Mobile.IiOSDevice) => this.debugBrkCore(device)).wait();
71+
this.$devicesService.execute((device: Mobile.IiOSDevice) => device.isEmulator ? this.emulatorDebugBrk() : this.debugBrkCore(device)).wait();
7272
}).future<void>()();
7373
}
7474

@@ -112,6 +112,9 @@ class IOSDebugService implements IDebugService {
112112
return (() => {
113113
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
114114
this.$devicesService.execute((device: iOSDevice.IOSDevice) => (() => {
115+
if(device.isEmulator) {
116+
return this.emulatorDebugBrk().wait();
117+
}
115118
// we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification
116119
let deploy = this.$platformService.deployOnDevice(this.platform);
117120
this.debugBrkCore(device).wait();
@@ -133,7 +136,7 @@ class IOSDebugService implements IDebugService {
133136
private deviceStart(): IFuture<void> {
134137
return (() => {
135138
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
136-
this.$devicesService.execute((device: Mobile.IiOSDevice) => this.deviceStartCore(device)).wait();
139+
this.$devicesService.execute((device: Mobile.IiOSDevice) => device.isEmulator ? this.emulatorStart() : this.deviceStartCore(device)).wait();
137140
}).future<void>()();
138141
}
139142

0 commit comments

Comments
 (0)