@@ -327,13 +327,15 @@ var lib = {
327
327
var options = { silent : true , runtimes : true } ;
328
328
var list = simctl . list ( options ) . json ;
329
329
330
- console . log ( 'Simulator SDK Roots:' ) ;
330
+ var output = 'Simulator SDK Roots:\n' ;
331
331
list . runtimes . forEach ( function ( runtime ) {
332
332
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' ) ;
335
335
}
336
336
} ) ;
337
+
338
+ return output ;
337
339
} ,
338
340
//jscs:enable disallowUnusedParams
339
341
@@ -378,9 +380,12 @@ var lib = {
378
380
379
381
//jscs:disable disallowUnusedParams
380
382
showdevicetypes : function ( args ) {
383
+ var output = '' ;
381
384
this . getdevicetypes ( ) . forEach ( function ( device ) {
382
- console . log ( device ) ;
385
+ output += util . format ( '%s\n' , device ) ;
383
386
} ) ;
387
+
388
+ return output ;
384
389
} ,
385
390
//jscs:enable disallowUnusedParams
386
391
@@ -475,13 +480,7 @@ var lib = {
475
480
} ,
476
481
477
482
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 ) ;
485
484
simctl . extensions . start ( device . id ) ;
486
485
} ,
487
486
0 commit comments