added setdevice command

This commit is contained in:
Dan Motzenbecker 2015-10-03 22:36:46 -04:00
parent bed6cca347
commit afb70bace0
1 changed files with 10 additions and 0 deletions

View File

@ -289,6 +289,16 @@ cli.command 'listdevices'
.map (line, i) -> "#{i}\t#{line.replace /\[.+\]/, ''}"
.join '\n')
cli.command 'setdevice <index>'
.description 'Choose simulator device by index'
.action (index) ->
unless device = getDeviceList()[parseInt index, 10]
logErr 'Invalid device index. Run natal listdevices for valid indexes.'
config = readConfig()
config.device = pluckUuid device
writeConfig config
unless semver.satisfies process.version[1...], nodeVersion
logErr """