1- import { EOL } from "os" ;
2-
3- export abstract class DebugPlatformCommand implements ICommand {
1+ export abstract class DebugPlatformCommand implements ICommand {
42 public allowedParameters : ICommandParameter [ ] = [ ] ;
53 public platform : string ;
64
@@ -12,7 +10,7 @@ export abstract class DebugPlatformCommand implements ICommand {
1210 protected $options : IOptions ,
1311 protected $platformsData : IPlatformsData ,
1412 protected $logger : ILogger ,
15- private $debugLiveSyncService : ILiveSyncService ,
13+ private $debugLiveSyncService : IDebugLiveSyncService ,
1614 private $config : IConfiguration ) {
1715 this . $projectData . initializeProjectData ( ) ;
1816 }
@@ -25,7 +23,7 @@ export abstract class DebugPlatformCommand implements ICommand {
2523 await this . $platformService . trackProjectType ( this . $projectData ) ;
2624
2725 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 ) ) ;
2927 }
3028
3129 this . $config . debugLivesync = true ;
@@ -96,12 +94,6 @@ export abstract class DebugPlatformCommand implements ICommand {
9694
9795 return true ;
9896 }
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- }
10597}
10698
10799export class DebugIOSCommand extends DebugPlatformCommand {
@@ -117,7 +109,7 @@ export class DebugIOSCommand extends DebugPlatformCommand {
117109 $projectData : IProjectData ,
118110 $platformsData : IPlatformsData ,
119111 $iosDeviceOperations : IIOSDeviceOperations ,
120- $debugLiveSyncService : ILiveSyncService ) {
112+ $debugLiveSyncService : IDebugLiveSyncService ) {
121113 super ( $iOSDebugService , $devicesService , $debugDataService , $platformService , $projectData , $options , $platformsData , $logger , $debugLiveSyncService , $config ) ;
122114 // 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.
123115 // 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 {
134126 return await super . canExecute ( args ) && await this . $platformService . validateOptions ( this . $options . provision , this . $projectData , this . $platformsData . availablePlatforms . iOS ) ;
135127 }
136128
137- protected printDebugInformation ( information : string [ ] ) : void {
138- if ( this . $options . chrome ) {
139- super . printDebugInformation ( information ) ;
140- }
141- }
142-
143129 public platform = this . $devicePlatformsConstants . iOS ;
144130}
145131
@@ -157,7 +143,7 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
157143 $options : IOptions ,
158144 $projectData : IProjectData ,
159145 $platformsData : IPlatformsData ,
160- $debugLiveSyncService : ILiveSyncService ) {
146+ $debugLiveSyncService : IDebugLiveSyncService ) {
161147 super ( $androidDebugService , $devicesService , $debugDataService , $platformService , $projectData , $options , $platformsData , $logger , $debugLiveSyncService , $config ) ;
162148 }
163149
0 commit comments