@@ -50,20 +50,7 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
5050 debugOptions . emulator = true ;
5151 }
5252
53- if ( ! debugOptions . justlaunch ) {
54- let projectName = debugData . projectName ;
55- if ( ! projectName && debugData . projectDir ) {
56- const projectData = this . $projectDataService . getProjectData ( debugData . projectDir ) ;
57- projectName = projectData . projectName ;
58- }
59-
60- if ( projectName ) {
61- this . $deviceLogProvider . setProjectNameForDevice ( debugData . deviceIdentifier , projectName ) ;
62- }
63-
64- await this . device . openDeviceLogStream ( { predicate : IOS_LOG_PREDICATE } ) ;
65- }
66-
53+ await this . startDeviceLogProcess ( debugData , debugOptions ) ;
6754 await this . $iOSDebuggerPortService . attachToDebuggerPortFoundEvent ( this . device , debugData , debugOptions ) ;
6855
6956 if ( debugOptions . emulator ) {
@@ -113,6 +100,26 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
113100 return chromeDebugUrl ;
114101 }
115102
103+ private async startDeviceLogProcess ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < void > {
104+ if ( debugOptions . justlaunch ) {
105+ // No logs should be printed on console when `--justlaunch` option is passed.
106+ // On the other side we need to start log process in order to get debugger port from logs.
107+ this . $deviceLogProvider . muteLogsForDevice ( debugData . deviceIdentifier ) ;
108+ }
109+
110+ let projectName = debugData . projectName ;
111+ if ( ! projectName && debugData . projectDir ) {
112+ const projectData = this . $projectDataService . getProjectData ( debugData . projectDir ) ;
113+ projectName = projectData . projectName ;
114+ }
115+
116+ if ( projectName ) {
117+ this . $deviceLogProvider . setProjectNameForDevice ( debugData . deviceIdentifier , projectName ) ;
118+ }
119+
120+ await this . device . openDeviceLogStream ( { predicate : IOS_LOG_PREDICATE } ) ;
121+ }
122+
116123 private async killProcess ( childProcess : ChildProcess ) : Promise < void > {
117124 if ( childProcess ) {
118125 return new Promise < void > ( ( resolve , reject ) => {
0 commit comments