Created
July 10, 2023 15:23
-
-
Save Lutzifer/6dbf8a370dfb19547f154feaf81bf13d to your computer and use it in GitHub Desktop.
Recreate simulators with fastlane, appending iOS Version to name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'parallel' | |
end | |
puts %x(bundle exec fastlane snapshot reset_simulators --force -i 16.4,17.0) | |
path = File.expand_path('~/Library/Developer/CoreSimulator/Devices/') | |
Parallel.each(Dir.entries(path)) do |entry| | |
next if entry == '.' || entry == '..' | |
full_path = File.join(path, entry) | |
if File.directory?(full_path) | |
name = %x(defaults read #{full_path}/device.plist name).strip! | |
runtime = %x(defaults read #{full_path}/device.plist runtime).split(".").last.strip! | |
if not name.empty? and not runtime.empty? | |
command = %Q(xcrun simctl rename #{entry} "#{name} #{runtime}") | |
puts command | |
%x(#{command}) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment