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

10 lines
265 B
Ruby
Raw Permalink Normal View History

#!/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