@@ -87,14 +87,14 @@ class AndroidDebugService implements IDebugService {
87
87
}
88
88
89
89
private unixSocketForward ( local : number , remote : string ) : IFuture < void > {
90
- return this . device . adb . executeCommand ( [ "forward" , `tcp:${ local . toString ( ) } ` , `localabstract:${ remote } ` ] ) ;
90
+ return this . device . adb . executeCommand ( [ "forward" , `tcp:${ local . toString ( ) } ` , `localabstract:${ remote } ` ] ) ;
91
91
}
92
92
93
93
private debugOnDevice ( ) : IFuture < void > {
94
94
return ( ( ) => {
95
95
let packageFile = "" ;
96
96
97
- if ( ! this . $options . debugBrk && ! this . $options . start && ! this . $options . getPort && ! this . $options . stop ) {
97
+ if ( ! this . $options . debugBrk && ! this . $options . start && ! this . $options . getPort && ! this . $options . stop ) {
98
98
this . $logger . warn ( "Neither --debug-brk nor --start option was specified. Defaulting to --debug-brk." ) ;
99
99
this . $options . debugBrk = true ;
100
100
}
@@ -110,14 +110,14 @@ class AndroidDebugService implements IDebugService {
110
110
this . $logger . out ( "Using " , packageFile ) ;
111
111
}
112
112
113
- this . $devicesService . initialize ( { platform : this . platform , deviceId : this . $options . device } ) . wait ( ) ;
113
+ this . $devicesService . initialize ( { platform : this . platform , deviceId : this . $options . device } ) . wait ( ) ;
114
114
let action = ( device : Mobile . IAndroidDevice ) : IFuture < void > => { return this . debugCore ( device , packageFile , this . $projectData . projectId ) ; } ;
115
115
this . $devicesService . execute ( action ) . wait ( ) ;
116
116
117
117
} ) . future < void > ( ) ( ) ;
118
118
}
119
119
120
- private debugCore ( device : Mobile . IAndroidDevice , packageFile : string , packageName : string ) : IFuture < void > {
120
+ private debugCore ( device : Mobile . IAndroidDevice , packageFile : string , packageName : string ) : IFuture < void > {
121
121
return ( ( ) => {
122
122
this . device = device ;
123
123
@@ -144,9 +144,8 @@ class AndroidDebugService implements IDebugService {
144
144
return ( ( ) => {
145
145
let startDebuggerCommand = [ "am" , "broadcast" , "-a" , '\"${packageName}-debug\"' , "--ez" , "enable" , "true" ] ;
146
146
this . device . adb . executeShellCommand ( startDebuggerCommand ) . wait ( ) ;
147
-
148
- if ( this . $options . client )
149
- {
147
+
148
+ if ( this . $options . client ) {
150
149
let port = this . getForwardedLocalDebugPortForPackageName ( deviceId , packageName ) . wait ( ) ;
151
150
this . startDebuggerClient ( port ) . wait ( ) ;
152
151
this . openDebuggerClient ( AndroidDebugService . DEFAULT_NODE_INSPECTOR_URL + "?port=" + port ) ;
@@ -160,7 +159,7 @@ class AndroidDebugService implements IDebugService {
160
159
161
160
private startAppWithDebugger ( packageFile : string , packageName : string ) : IFuture < void > {
162
161
return ( ( ) => {
163
- if ( ! this . $options . emulator ) {
162
+ if ( ! this . $options . emulator ) {
164
163
this . device . applicationManager . uninstallApplication ( packageName ) . wait ( ) ;
165
164
this . device . applicationManager . installApplication ( packageFile ) . wait ( ) ;
166
165
}
@@ -170,7 +169,7 @@ class AndroidDebugService implements IDebugService {
170
169
171
170
public debugStart ( ) : IFuture < void > {
172
171
return ( ( ) => {
173
- this . $devicesService . initialize ( { platform : this . platform , deviceId : this . $options . device } ) . wait ( ) ;
172
+ this . $devicesService . initialize ( { platform : this . platform , deviceId : this . $options . device } ) . wait ( ) ;
174
173
let action = ( device : Mobile . IAndroidDevice ) : IFuture < void > => {
175
174
this . device = device ;
176
175
return this . debugStartCore ( ) ;
@@ -188,8 +187,7 @@ class AndroidDebugService implements IDebugService {
188
187
this . device . applicationManager . stopApplication ( packageName ) . wait ( ) ;
189
188
this . device . applicationManager . startApplication ( packageName ) . wait ( ) ;
190
189
191
- if ( this . $options . client )
192
- {
190
+ if ( this . $options . client ) {
193
191
let localDebugPort = this . getForwardedLocalDebugPortForPackageName ( this . device . deviceInfo . identifier , packageName ) . wait ( ) ;
194
192
this . startDebuggerClient ( localDebugPort ) . wait ( ) ;
195
193
this . openDebuggerClient ( AndroidDebugService . DEFAULT_NODE_INSPECTOR_URL + "?port=" + localDebugPort ) ;
@@ -208,16 +206,16 @@ class AndroidDebugService implements IDebugService {
208
206
209
207
private openDebuggerClient ( url : string ) : void {
210
208
let defaultDebugUI = "chrome" ;
211
- if ( this . $hostInfo . isDarwin ) {
209
+ if ( this . $hostInfo . isDarwin ) {
212
210
defaultDebugUI = "Google Chrome" ;
213
211
}
214
- if ( this . $hostInfo . isLinux ) {
212
+ if ( this . $hostInfo . isLinux ) {
215
213
defaultDebugUI = "google-chrome" ;
216
214
}
217
215
218
216
let debugUI = this . $config . ANDROID_DEBUG_UI || defaultDebugUI ;
219
217
let child = this . $opener . open ( url , debugUI ) ;
220
- if ( ! child ) {
218
+ if ( ! child ) {
221
219
this . $errors . failWithoutHelp ( `Unable to open ${ debugUI } .` ) ;
222
220
}
223
221
}
0 commit comments