File tree 1 file changed +15
-1
lines changed
lib/common/mobile/ios/simulator 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,21 @@ export class IOSSimulator extends IOSDeviceBase implements Mobile.IiOSDevice {
87
87
attachRequestMessage ,
88
88
this . deviceInfo . identifier
89
89
) ;
90
- const port = await super . getDebuggerPort ( appId ) ;
90
+
91
+ // Retry posting the notification every five seconds, in case the AttachRequest
92
+ // event handler wasn't registered when the first one was sent
93
+ const postNotificationRetryInterval = setInterval ( ( ) => {
94
+ this . $iOSEmulatorServices
95
+ . postDarwinNotification (
96
+ attachRequestMessage ,
97
+ this . deviceInfo . identifier
98
+ )
99
+ . catch ( ( e ) => this . $logger . error ( e ) ) ;
100
+ } , 5e3 ) ;
101
+
102
+ const port = await super . getDebuggerPort ( appId ) . finally ( ( ) => {
103
+ clearInterval ( postNotificationRetryInterval ) ;
104
+ } ) ;
91
105
try {
92
106
socket = await helpers . connectEventuallyUntilTimeout ( async ( ) => {
93
107
return this . $iOSEmulatorServices . connectToPort ( { port } ) ;
You can’t perform that action at this time.
0 commit comments