Skip to content

debug break for ios fixed #1928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ interface IiOSNotificationService {
}

interface IiOSSocketRequestExecutor {
executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number): IFuture<void>;
executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number, shouldBreak?: boolean): IFuture<void>;
executeAttachRequest(device: Mobile.IiOSDevice, timeout: number): IFuture<void>;
}

Expand Down
6 changes: 4 additions & 2 deletions lib/device-sockets/ios/socket-request-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
}).future<void>()();
}

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

try {
this.$iOSNotificationService.awaitNotification(npc, this.$iOSNotification.appLaunching, timeout).wait();
process.nextTick(() => {
npc.postNotificationAndAttachForData(this.$iOSNotification.waitForDebug );
if(shouldBreak) {
npc.postNotificationAndAttachForData(this.$iOSNotification.waitForDebug );
}
npc.postNotificationAndAttachForData(this.$iOSNotification.attachRequest);
});

Expand Down
11 changes: 4 additions & 7 deletions lib/services/ios-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ class IOSDebugService implements IDebugService {
} else if (this.$options.start) {
return this.deviceStart();
} else {
let deploy = this.$platformService.deployOnDevice(this.platform);
deploy.wait();

return this.deviceStart();
return this.deviceDebugBrk(false);
}
}
}
Expand Down Expand Up @@ -121,18 +118,18 @@ class IOSDebugService implements IDebugService {
}
// we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification
let deploy = this.$platformService.deployOnDevice(this.platform);
this.debugBrkCore(device).wait();
this.debugBrkCore(device, shouldBreak).wait();
deploy.wait();
}).future<void>()()).wait();
}).future<void>()();
}

private debugBrkCore(device: Mobile.IiOSDevice): IFuture<void> {
private debugBrkCore(device: Mobile.IiOSDevice, shouldBreak?: boolean): IFuture<void> {
return (() => {
let timeout = this.$utils.getMilliSecondsTimeout(TIMEOUT_SECONDS);
let readyForAttachTimeout = this.getReadyForAttachTimeout(timeout);

this.$iOSSocketRequestExecutor.executeLaunchRequest(device, timeout, readyForAttachTimeout).wait();
this.$iOSSocketRequestExecutor.executeLaunchRequest(device, timeout, readyForAttachTimeout, shouldBreak).wait();
this.wireDebuggerClient(() => device.connectToPort(inspectorBackendPort)).wait();
}).future<void>()();
}
Expand Down