Skip to content

Commit e07b74a

Browse files
authored
Merge pull request #1928 from NativeScript/no-break-ios
debug break for ios fixed
2 parents 225d0c4 + ddcd013 commit e07b74a

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

lib/declarations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ interface IiOSNotificationService {
234234
}
235235

236236
interface IiOSSocketRequestExecutor {
237-
executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number): IFuture<void>;
237+
executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number, shouldBreak?: boolean): IFuture<void>;
238238
executeAttachRequest(device: Mobile.IiOSDevice, timeout: number): IFuture<void>;
239239
}
240240

lib/device-sockets/ios/socket-request-executor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
3939
}).future<void>()();
4040
}
4141

42-
public executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number): IFuture<void> {
42+
public executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number, shouldBreak?: boolean): IFuture<void> {
4343
return (() => {
4444
let npc = new iOSProxyServices.NotificationProxyClient(device, this.$injector);
4545

4646
try {
4747
this.$iOSNotificationService.awaitNotification(npc, this.$iOSNotification.appLaunching, timeout).wait();
4848
process.nextTick(() => {
49-
npc.postNotificationAndAttachForData(this.$iOSNotification.waitForDebug );
49+
if(shouldBreak) {
50+
npc.postNotificationAndAttachForData(this.$iOSNotification.waitForDebug );
51+
}
5052
npc.postNotificationAndAttachForData(this.$iOSNotification.attachRequest);
5153
});
5254

lib/services/ios-debug-service.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ class IOSDebugService implements IDebugService {
5858
} else if (this.$options.start) {
5959
return this.deviceStart();
6060
} else {
61-
let deploy = this.$platformService.deployOnDevice(this.platform);
62-
deploy.wait();
63-
64-
return this.deviceStart();
61+
return this.deviceDebugBrk(false);
6562
}
6663
}
6764
}
@@ -121,18 +118,18 @@ class IOSDebugService implements IDebugService {
121118
}
122119
// we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification
123120
let deploy = this.$platformService.deployOnDevice(this.platform);
124-
this.debugBrkCore(device).wait();
121+
this.debugBrkCore(device, shouldBreak).wait();
125122
deploy.wait();
126123
}).future<void>()()).wait();
127124
}).future<void>()();
128125
}
129126

130-
private debugBrkCore(device: Mobile.IiOSDevice): IFuture<void> {
127+
private debugBrkCore(device: Mobile.IiOSDevice, shouldBreak?: boolean): IFuture<void> {
131128
return (() => {
132129
let timeout = this.$utils.getMilliSecondsTimeout(TIMEOUT_SECONDS);
133130
let readyForAttachTimeout = this.getReadyForAttachTimeout(timeout);
134131

135-
this.$iOSSocketRequestExecutor.executeLaunchRequest(device, timeout, readyForAttachTimeout).wait();
132+
this.$iOSSocketRequestExecutor.executeLaunchRequest(device, timeout, readyForAttachTimeout, shouldBreak).wait();
136133
this.wireDebuggerClient(() => device.connectToPort(inspectorBackendPort)).wait();
137134
}).future<void>()();
138135
}

0 commit comments

Comments
 (0)