@@ -327,13 +327,15 @@ var lib = {
327327 var options = { silent : true , runtimes : true } ;
328328 var list = simctl . list ( options ) . json ;
329329
330- console . log ( 'Simulator SDK Roots:' ) ;
330+ var output = 'Simulator SDK Roots:\n' ;
331331 list . runtimes . forEach ( function ( runtime ) {
332332 if ( runtime . availability === '(available)' ) {
333- console . log ( util . format ( '"%s" (%s)' , runtime . name , runtime . buildversion ) ) ;
334- console . log ( util . format ( '\t(unknown)' ) ) ;
333+ output += util . format ( '"%s" (%s)\n ' , runtime . name , runtime . buildversion ) ;
334+ output += util . format ( '\t(unknown)\n' ) ;
335335 }
336336 } ) ;
337+
338+ return output ;
337339 } ,
338340 //jscs:enable disallowUnusedParams
339341
@@ -378,9 +380,12 @@ var lib = {
378380
379381 //jscs:disable disallowUnusedParams
380382 showdevicetypes : function ( args ) {
383+ var output = '' ;
381384 this . getdevicetypes ( ) . forEach ( function ( device ) {
382- console . log ( device ) ;
385+ output += util . format ( '%s\n' , device ) ;
383386 } ) ;
387+
388+ return output ;
384389 } ,
385390 //jscs:enable disallowUnusedParams
386391
@@ -475,13 +480,7 @@ var lib = {
475480 } ,
476481
477482 start : function ( devicetypeid ) {
478- var device = { } ;
479- try {
480- device = getDeviceFromDeviceTypeId ( devicetypeid ) ;
481- } catch ( e ) {
482- console . error ( e ) ;
483- }
484-
483+ var device = getDeviceFromDeviceTypeId ( devicetypeid ) ;
485484 simctl . extensions . start ( device . id ) ;
486485 } ,
487486
0 commit comments