@@ -138,7 +138,7 @@ export class IosProject extends NSProject {
138138
139139 let rebuild = ( args . request == "launch" ) ? ( args as ILaunchRequestArgs ) . rebuild : true ;
140140 // build command to execute
141- let command = new CommandBuilder ( )
141+ let command = new CommandBuilder ( args . nativescriptCliPath )
142142 . appendParam ( "debug" )
143143 . appendParam ( this . platform ( ) )
144144 . appendParamIf ( "--emulator" , args . emulator )
@@ -232,7 +232,7 @@ export class AndroidProject extends NSProject {
232232 let launched = false ;
233233
234234 return new Promise < void > ( ( resolve , reject ) => {
235- let command = new CommandBuilder ( )
235+ let command = new CommandBuilder ( args . nativescriptCliPath )
236236 . appendParam ( "debug" )
237237 . appendParam ( this . platform ( ) )
238238 . appendParamIf ( "--emulator" , args . emulator )
@@ -286,7 +286,7 @@ export class AndroidProject extends NSProject {
286286
287287 //return Promise.resolve(40001);
288288
289- let command = new CommandBuilder ( )
289+ let command = new CommandBuilder ( args . nativescriptCliPath )
290290 . appendParam ( "debug" )
291291 . appendParam ( this . platform ( ) )
292292 . appendParam ( "--get-port" )
@@ -337,10 +337,14 @@ export class AndroidProject extends NSProject {
337337}
338338
339339class CommandBuilder {
340- public static tnsPath : string = 'tns' ;
341340
341+ private _tnsPath : string ;
342342 private _command : string [ ] = [ ] ;
343343
344+ constructor ( tnsPath ?: string ) {
345+ this . _tnsPath = tnsPath || "tns" ;
346+ }
347+
344348 public appendParam ( parameter : string ) : CommandBuilder {
345349 this . _command . push ( parameter ) ;
346350 return this ;
@@ -359,7 +363,7 @@ class CommandBuilder {
359363 }
360364
361365 public build ( ) : { path : string , args : string [ ] } {
362- return { path : CommandBuilder . tnsPath , args : this . _command } ;
366+ return { path : this . _tnsPath , args : this . _command } ;
363367 }
364368
365369 public buildAsString ( ) : string {
0 commit comments