@@ -39,7 +39,9 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
3939 return "ios" ;
4040 }
4141
42- public debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
42+ public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
43+ await this . device . openDeviceLogStream ( ) ;
44+
4345 if ( debugOptions . debugBrk && debugOptions . start ) {
4446 this . $errors . failWithoutHelp ( "Expected exactly one of the --debug-brk or --start options." ) ;
4547 }
@@ -106,12 +108,13 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
106108
107109 private async emulatorDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
108110 const args = debugOptions . debugBrk ? "--nativescript-debug-brk" : "--nativescript-debug-start" ;
109- const launchResult = await this . $iOSEmulatorServices . runApplicationOnEmulator ( debugData . pathToAppPackage , {
111+ const launchResult = await this . $iOSEmulatorServices . runApplicationOnEmulator ( debugData . pathToAppPackage , {
110112 waitForDebugger : true ,
111113 captureStdin : true ,
112114 args : args ,
113115 appId : debugData . applicationIdentifier ,
114- skipInstall : true
116+ skipInstall : true ,
117+ device : debugData . deviceIdentifier
115118 } ) ;
116119
117120 const pid = getPidFromiOSSimulatorLogs ( debugData . applicationIdentifier , launchResult ) ;
@@ -126,6 +129,8 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
126129 }
127130
128131 private async emulatorStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
132+ const device = await this . $devicesService . getDevice ( debugData . deviceIdentifier ) ;
133+ this . $iOSDebuggerPortService . attachToDebuggerPortFoundEvent ( device ) ;
129134 const result = await this . wireDebuggerClient ( debugData , debugOptions ) ;
130135
131136 const attachRequestMessage = this . $iOSNotification . getAttachRequest ( debugData . applicationIdentifier , debugData . deviceIdentifier ) ;
@@ -174,6 +179,7 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
174179 }
175180
176181 private async deviceStartCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
182+ this . $iOSDebuggerPortService . attachToDebuggerPortFoundEvent ( device ) ;
177183 await this . $iOSSocketRequestExecutor . executeAttachRequest ( device , AWAIT_NOTIFICATION_TIMEOUT_SECONDS , debugData . applicationIdentifier ) ;
178184 return this . wireDebuggerClient ( debugData , debugOptions , device ) ;
179185 }
0 commit comments