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 {
242242 let child : ChildProcess = exec ( command , { cwd : this . projectPath ( ) } ) ;
243243 child . stdout . on ( 'data' , function ( data ) {
244244 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})" ) ;
246247
247248 //for the new output
248249 // 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);
252250
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+
255258 if ( portNumberMatch ) {
259+ Logger . log ( "port number match '" + portNumberMatch + "'" ) ;
256260 let portNumber = parseInt ( portNumberMatch ) ;
257261 if ( portNumber ) {
258262 Logger . log ( "port number " + portNumber ) ;
You can’t perform that action at this time.
0 commit comments