@@ -137,17 +137,21 @@ class AndroidDebugService implements IDebugService {
137
137
return ( ( ) => {
138
138
let port = this . getForwardedLocalDebugPortForPackageName ( deviceId , packageName ) . wait ( ) ;
139
139
this . $logger . info ( "device: " + deviceId + " debug port: " + port + "\n" ) ;
140
+ this . $logger . info ( "client options " + this . $options . client ) ;
140
141
} ) . future < void > ( ) ( ) ;
141
142
}
142
143
143
144
private attachDebugger ( deviceId : string , packageName : string ) : IFuture < void > {
144
145
return ( ( ) => {
145
146
let startDebuggerCommand = [ "am" , "broadcast" , "-a" , '\"${packageName}-debug\"' , "--ez" , "enable" , "true" ] ;
146
147
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
+ }
151
155
} ) . future < void > ( ) ( ) ;
152
156
}
153
157
@@ -185,9 +189,12 @@ class AndroidDebugService implements IDebugService {
185
189
this . device . applicationManager . stopApplication ( packageName ) . wait ( ) ;
186
190
this . device . applicationManager . startApplication ( packageName ) . wait ( ) ;
187
191
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
+ }
191
198
} ) . future < void > ( ) ( ) ;
192
199
}
193
200
0 commit comments