@@ -137,17 +137,21 @@ class AndroidDebugService implements IDebugService {
137137 return ( ( ) => {
138138 let port = this . getForwardedLocalDebugPortForPackageName ( deviceId , packageName ) . wait ( ) ;
139139 this . $logger . info ( "device: " + deviceId + " debug port: " + port + "\n" ) ;
140+ this . $logger . info ( "client options " + this . $options . client ) ;
140141 } ) . future < void > ( ) ( ) ;
141142 }
142143
143144 private attachDebugger ( deviceId : string , packageName : string ) : IFuture < void > {
144145 return ( ( ) => {
145146 let startDebuggerCommand = [ "am" , "broadcast" , "-a" , '\"${packageName}-debug\"' , "--ez" , "enable" , "true" ] ;
146147 this . device . adb . executeShellCommand ( startDebuggerCommand ) . wait ( ) ;
147-
148- let port = this . getForwardedLocalDebugPortForPackageName ( deviceId , packageName ) . wait ( ) ;
149- this . startDebuggerClient ( port ) . wait ( ) ;
150- this . openDebuggerClient ( AndroidDebugService . DEFAULT_NODE_INSPECTOR_URL + "?port=" + port ) ;
148+
149+ if ( this . $options . client )
150+ {
151+ let port = this . getForwardedLocalDebugPortForPackageName ( deviceId , packageName ) . wait ( ) ;
152+ this . startDebuggerClient ( port ) . wait ( ) ;
153+ this . openDebuggerClient ( AndroidDebugService . DEFAULT_NODE_INSPECTOR_URL + "?port=" + port ) ;
154+ }
151155 } ) . future < void > ( ) ( ) ;
152156 }
153157
@@ -185,9 +189,12 @@ class AndroidDebugService implements IDebugService {
185189 this . device . applicationManager . stopApplication ( packageName ) . wait ( ) ;
186190 this . device . applicationManager . startApplication ( packageName ) . wait ( ) ;
187191
188- let localDebugPort = this . getForwardedLocalDebugPortForPackageName ( this . device . deviceInfo . identifier , packageName ) . wait ( ) ;
189- this . startDebuggerClient ( localDebugPort ) . wait ( ) ;
190- this . openDebuggerClient ( AndroidDebugService . DEFAULT_NODE_INSPECTOR_URL + "?port=" + localDebugPort ) ;
192+ if ( this . $options . client )
193+ {
194+ let localDebugPort = this . getForwardedLocalDebugPortForPackageName ( this . device . deviceInfo . identifier , packageName ) . wait ( ) ;
195+ this . startDebuggerClient ( localDebugPort ) . wait ( ) ;
196+ this . openDebuggerClient ( AndroidDebugService . DEFAULT_NODE_INSPECTOR_URL + "?port=" + localDebugPort ) ;
197+ }
191198 } ) . future < void > ( ) ( ) ;
192199 }
193200
0 commit comments