@@ -39,7 +39,9 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
39
39
return "ios" ;
40
40
}
41
41
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
+
43
45
if ( debugOptions . debugBrk && debugOptions . start ) {
44
46
this . $errors . failWithoutHelp ( "Expected exactly one of the --debug-brk or --start options." ) ;
45
47
}
@@ -106,12 +108,13 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
106
108
107
109
private async emulatorDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
108
110
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 , {
110
112
waitForDebugger : true ,
111
113
captureStdin : true ,
112
114
args : args ,
113
115
appId : debugData . applicationIdentifier ,
114
- skipInstall : true
116
+ skipInstall : true ,
117
+ device : debugData . deviceIdentifier
115
118
} ) ;
116
119
117
120
const pid = getPidFromiOSSimulatorLogs ( debugData . applicationIdentifier , launchResult ) ;
@@ -126,6 +129,8 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
126
129
}
127
130
128
131
private async emulatorStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
132
+ const device = await this . $devicesService . getDevice ( debugData . deviceIdentifier ) ;
133
+ this . $iOSDebuggerPortService . attachToDebuggerPortFoundEvent ( device ) ;
129
134
const result = await this . wireDebuggerClient ( debugData , debugOptions ) ;
130
135
131
136
const attachRequestMessage = this . $iOSNotification . getAttachRequest ( debugData . applicationIdentifier , debugData . deviceIdentifier ) ;
@@ -174,6 +179,7 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
174
179
}
175
180
176
181
private async deviceStartCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
182
+ this . $iOSDebuggerPortService . attachToDebuggerPortFoundEvent ( device ) ;
177
183
await this . $iOSSocketRequestExecutor . executeAttachRequest ( device , AWAIT_NOTIFICATION_TIMEOUT_SECONDS , debugData . applicationIdentifier ) ;
178
184
return this . wireDebuggerClient ( debugData , debugOptions , device ) ;
179
185
}
0 commit comments