From 84dc7280660656d2996cca916ad2b83dab5f270f Mon Sep 17 00:00:00 2001 From: Dan Motzenbecker Date: Sat, 19 Sep 2015 15:35:00 -0400 Subject: [PATCH] added listdevices task --- main.coffee | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/main.coffee b/main.coffee index b2c7f05..2772603 100644 --- a/main.coffee +++ b/main.coffee @@ -213,6 +213,16 @@ openXcode = (name) -> message +getDeviceList = -> + try + execSync 'xcrun instruments -s' + .toString() + .split '\n' + .filter (line) -> /^i/.test line + catch {message} + logErr 'Device listing failed: ' + message + + cli.version '0.0.4' cli.command 'init ' @@ -227,10 +237,22 @@ cli.command 'init ' init name +cli.command 'launch' + .description 'Run project in simulator and start REPL' + .action -> + launch readConfig() + cli.command 'xcode' .description 'Open Xcode project' .action -> openXcode readConfig().name +cli.command 'listdevices' + .description 'List available simulator devices by index' + .action -> + console.log (getDeviceList() + .map (line, i) -> "#{i}\t#{line}" + .join '\n') + cli.parse process.argv