1
- import { EOL } from "os" ;
2
-
3
- export abstract class DebugPlatformCommand implements ICommand {
1
+ export abstract class DebugPlatformCommand implements ICommand {
4
2
public allowedParameters : ICommandParameter [ ] = [ ] ;
5
3
public platform : string ;
6
4
@@ -12,7 +10,7 @@ export abstract class DebugPlatformCommand implements ICommand {
12
10
protected $options : IOptions ,
13
11
protected $platformsData : IPlatformsData ,
14
12
protected $logger : ILogger ,
15
- private $debugLiveSyncService : ILiveSyncService ,
13
+ private $debugLiveSyncService : IDebugLiveSyncService ,
16
14
private $config : IConfiguration ) {
17
15
this . $projectData . initializeProjectData ( ) ;
18
16
}
@@ -25,7 +23,7 @@ export abstract class DebugPlatformCommand implements ICommand {
25
23
await this . $platformService . trackProjectType ( this . $projectData ) ;
26
24
27
25
if ( this . $options . start ) {
28
- return this . printDebugInformation ( await this . debugService . debug < string [ ] > ( debugData , debugOptions ) ) ;
26
+ return this . $debugLiveSyncService . printDebugInformation ( await this . debugService . debug < string [ ] > ( debugData , debugOptions ) ) ;
29
27
}
30
28
31
29
this . $config . debugLivesync = true ;
@@ -96,12 +94,6 @@ export abstract class DebugPlatformCommand implements ICommand {
96
94
97
95
return true ;
98
96
}
99
-
100
- protected printDebugInformation ( information : string [ ] ) : void {
101
- _ . each ( information , i => {
102
- this . $logger . info ( `To start debugging, open the following URL in Chrome:${ EOL } ${ i } ${ EOL } ` . cyan ) ;
103
- } ) ;
104
- }
105
97
}
106
98
107
99
export class DebugIOSCommand extends DebugPlatformCommand {
@@ -117,7 +109,7 @@ export class DebugIOSCommand extends DebugPlatformCommand {
117
109
$projectData : IProjectData ,
118
110
$platformsData : IPlatformsData ,
119
111
$iosDeviceOperations : IIOSDeviceOperations ,
120
- $debugLiveSyncService : ILiveSyncService ) {
112
+ $debugLiveSyncService : IDebugLiveSyncService ) {
121
113
super ( $iOSDebugService , $devicesService , $debugDataService , $platformService , $projectData , $options , $platformsData , $logger , $debugLiveSyncService , $config ) ;
122
114
// Do not dispose ios-device-lib, so the process will remain alive and the debug application (NativeScript Inspector or Chrome DevTools) will be able to connect to the socket.
123
115
// In case we dispose ios-device-lib, the socket will be closed and the code will fail when the debug application tries to read/send data to device socket.
@@ -134,12 +126,6 @@ export class DebugIOSCommand extends DebugPlatformCommand {
134
126
return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $options . provision , this . $projectData , this . $platformsData . availablePlatforms . iOS ) ;
135
127
}
136
128
137
- protected printDebugInformation ( information : string [ ] ) : void {
138
- if ( this . $options . chrome ) {
139
- super . printDebugInformation ( information ) ;
140
- }
141
- }
142
-
143
129
public platform = this . $devicePlatformsConstants . iOS ;
144
130
}
145
131
@@ -157,7 +143,7 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
157
143
$options : IOptions ,
158
144
$projectData : IProjectData ,
159
145
$platformsData : IPlatformsData ,
160
- $debugLiveSyncService : ILiveSyncService ) {
146
+ $debugLiveSyncService : IDebugLiveSyncService ) {
161
147
super ( $androidDebugService , $devicesService , $debugDataService , $platformService , $projectData , $options , $platformsData , $logger , $debugLiveSyncService , $config ) ;
162
148
}
163
149
0 commit comments