Skip to content
Merged
Changes from 1 commit
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
16 changes: 15 additions & 1 deletion lib/common/mobile/ios/simulator/ios-simulator-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,21 @@ export class IOSSimulator extends IOSDeviceBase implements Mobile.IiOSDevice {
attachRequestMessage,
this.deviceInfo.identifier
);
const port = await super.getDebuggerPort(appId);

// Retry posting the notification every five seconds, in case the AttachRequest
// event handler wasn't registered when the first one was sent
const postNotificationRetryInterval = setInterval(() => {
this.$iOSEmulatorServices
.postDarwinNotification(
attachRequestMessage,
this.deviceInfo.identifier
)
.catch((e) => this.$logger.error(e));
}, 5e3);

const port = await super.getDebuggerPort(appId).finally(() => {
clearInterval(postNotificationRetryInterval);
});
try {
socket = await helpers.connectEventuallyUntilTimeout(async () => {
return this.$iOSEmulatorServices.connectToPort({ port });
Expand Down