File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -242,17 +242,21 @@ export class AndroidProject extends NSProject {
242
242
let child : ChildProcess = exec ( command , { cwd : this . projectPath ( ) } ) ;
243
243
child . stdout . on ( 'data' , function ( data ) {
244
244
that . emit ( 'TNS.outputMessage' , data . toString ( ) , 'log' ) ;
245
- let regexp = new RegExp ( " ([\\d]{5})" , "g" ) ;
245
+
246
+ let regexp = new RegExp ( "(?:debug port: )([\\d]{5})" ) ;
246
247
247
248
//for the new output
248
249
// var input = "device: 030b258308e6ce89 debug port: 40001";
249
- // var regexp = new RegExp("(?:^device: )([\\S]+)(?: debug port: )([\\d]+)", "g");
250
- // var match = regexp.exec(input);
251
- // console.log(match);
252
250
253
- let portNumberMatch = data . toString ( ) . match ( regexp )
254
- Logger . log ( "port number match " + portNumberMatch ) ;
251
+ let portNumberMatch = null ;
252
+ let match = data . toString ( ) . match ( regexp ) ;
253
+ if ( match )
254
+ {
255
+ portNumberMatch = match [ 1 ] ;
256
+ }
257
+
255
258
if ( portNumberMatch ) {
259
+ Logger . log ( "port number match '" + portNumberMatch + "'" ) ;
256
260
let portNumber = parseInt ( portNumberMatch ) ;
257
261
if ( portNumber ) {
258
262
Logger . log ( "port number " + portNumber ) ;
You can’t perform that action at this time.
0 commit comments