realm-js/scripts/find-ios-runtime.rb

10 lines
265 B
Ruby

#!/usr/bin/ruby
require 'json'
runtime = JSON.parse(%x{xcrun simctl list devices --json})['runtimes']
.select{|x| (x['identifier'].include? 'com.apple.CoreSimulator.SimRuntime.iOS') &&
(x['availability'] == "(available)")}[0]["identifier"]
puts runtime